updated CMakeLists.txt

This commit is contained in:
Arvid Norberg 2009-02-13 07:10:27 +00:00
parent 373c19dadd
commit 82823c62d9
1 changed files with 10 additions and 2 deletions

View File

@ -99,6 +99,7 @@ option(dht "enable support for Mainline DHT" ON)
option(resolve-countries "enable support for resolving countries from peer IPs" ON) option(resolve-countries "enable support for resolving countries from peer IPs" ON)
option(unicode "enable unicode support" ON) option(unicode "enable unicode support" ON)
option(deprecated-functions "enable deprecated functions for backwards compatibility" ON) option(deprecated-functions "enable deprecated functions for backwards compatibility" ON)
option(exceptions "build with exception support" ON)
option(build_tests "build tests" ON) option(build_tests "build tests" ON)
option(build_examples "build examples" ON) option(build_examples "build examples" ON)
@ -130,8 +131,9 @@ else (dht)
add_definitions(-DTORRENT_DISABLE_DHT) add_definitions(-DTORRENT_DISABLE_DHT)
endif (dht) endif (dht)
if (shared)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
if (shared)
add_library(torrent-rasterbar SHARED ${sources2} ${zlib_sources2}) add_library(torrent-rasterbar SHARED ${sources2} ${zlib_sources2})
else (shared) else (shared)
add_library(torrent-rasterbar STATIC ${sources2} ${zlib_sources2}) add_library(torrent-rasterbar STATIC ${sources2} ${zlib_sources2})
@ -180,6 +182,12 @@ if (NOT deprecated-functions)
add_definitions(-DTORRENT_NO_DEPRECATE) add_definitions(-DTORRENT_NO_DEPRECATE)
endif (NOT deprecated-functions) endif (NOT deprecated-functions)
if (exceptions)
add_definitions(-fexceptions)
else (exceptions)
add_definitions(-fno-exceptions)
endif (exceptions)
if (MSVC) if (MSVC)
# disable bogus deprecation warnings on msvc8 # disable bogus deprecation warnings on msvc8
add_definitions(-D_SCL_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE) add_definitions(-D_SCL_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE)
@ -217,7 +225,7 @@ endforeach (s)
configure_file(libtorrent-rasterbar-cmake.pc.in libtorrent-rasterbar.pc) configure_file(libtorrent-rasterbar-cmake.pc.in libtorrent-rasterbar.pc)
install(TARGETS torrent-rasterbar DESTINATION lib) install(TARGETS torrent-rasterbar DESTINATION lib CONFIGURATIONS release)
install(DIRECTORY include/libtorrent install(DIRECTORY include/libtorrent
DESTINATION include DESTINATION include
PATTERN ".svn" EXCLUDE) PATTERN ".svn" EXCLUDE)