diff options
author | Riccardo Spagni <ric@spagni.net> | 2014-10-07 00:21:40 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2014-10-07 00:21:53 +0200 |
commit | 6f65ab1904543f103c0187e2362604cc22f5d337 (patch) | |
tree | ff1a23128c9b2e326f97a9aad10251c25cbe3ff0 /CMakeLists.txt | |
parent | Merge pull request #173 (diff) | |
parent | added hardcoded checkpoint at block 249380 (diff) | |
download | monero-6f65ab1904543f103c0187e2362604cc22f5d337.tar.xz |
Merge pull request #175
b419075 added hardcoded checkpoint at block 249380 (Riccardo Spagni)
7c1d3b5 fixed miniupnpc dynamic target (Riccardo Spagni)
26728d9 mingw library tweaks (Riccardo Spagni)
2cf94c1 fix for mingw not playing nicely with libunbound configure, fix for correctly finding static libs on various operating systems (Riccardo Spagni)
b05e27f need to link with -ldl on Linux when building statically (Riccardo Spagni)
e55982a set the winsock variable differently on Windows (Riccardo Spagni)
0586a27 fixed configure_command for libunbound under mingw (Riccardo Spagni)
f8fd036 turns out mingw does actually produce .a libs and not .dll.a (Riccardo Spagni)
6be3d1d added bison/yacc static build dependency (Riccardo Spagni)
1afba73 quieten CMake when it can't find packages (Riccardo Spagni)
735a017 removed required flags from miniupnp and unbound (Riccardo Spagni)
6b7ac4b enforce static libraries when building statically (Riccardo Spagni)
1d5991e include openssl in linbunbound static linking, added errors for openssl and expat (Riccardo Spagni)
6ef8ae8 reference the correct unbound static lib (Riccardo Spagni)
23cc93c added libtool's install command (Riccardo Spagni)
409e9ba use the correct CMake variable for static builds (Riccardo Spagni)
3a0b00a build libunbound correctly (Riccardo Spagni)
75a616f fix missing parentheses (Riccardo Spagni)
59172ee build libunbound from external if no local libunbound or for static builds (Riccardo Spagni)
1dee71a added static build dependency instructions to README (Riccardo Spagni)
ff3a766 added static build dependency instructions to README (Riccardo Spagni)
5829b35 include openssl in linbunbound static linking, added errors for openssl and expat (Riccardo Spagni)
c70fa86 reference the correct unbound static lib (Riccardo Spagni)
954a244 added libtool's install command (Riccardo Spagni)
fd52015 use the correct CMake variable for static builds (Riccardo Spagni)
cc0f6a6 build libunbound correctly (Riccardo Spagni)
8c00098 fix missing parentheses (Riccardo Spagni)
cee8747 build libunbound from external if no local libunbound or for static builds (Riccardo Spagni)
add1a60 added static build dependency instructions to README (Riccardo Spagni)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e908e0dfe..78e4b426f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,13 +87,30 @@ else() endif() set(STATIC ${DEFAULT_STATIC} CACHE BOOL "Link libraries statically") +IF(STATIC) + IF(MSVC) + SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll.a .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + ELSE() + SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + ENDIF() +ENDIF() + if (UNIX AND NOT APPLE) # Note that at the time of this writing the -Wstrict-prototypes flag added below will make this fail find_package(Threads) endif() -# Find unbound - don't move this to the end, cmake is weird about this -find_package(Unbound REQUIRED) +add_subdirectory(external) + +# Final setup for miniupnpc +if(UPNP_STATIC) + add_definitions("-DUPNP_STATIC") +else() + add_definitions("-DUPNP_DYNAMIC") + include_directories(${UPNP_INCLUDE}) +endif() + +# Final setup for libunbound include_directories(${UNBOUND_INCLUDE}) if(MSVC) @@ -184,7 +201,7 @@ if(STATIC) set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_STATIC_RUNTIME ON) endif() -find_package(Boost 1.53 REQUIRED COMPONENTS system filesystem thread date_time chrono regex serialization program_options) +find_package(Boost 1.53 QUIET REQUIRED COMPONENTS system filesystem thread date_time chrono regex serialization program_options) if(NOT Boost_FOUND) MESSAGE(FATAL_ERROR "${BoldRed}Could not find Boost libraries, please make sure you have installed Boost or libboost-all-dev (1.53 or 1.55+) or the equivalent${ColourReset}") @@ -196,11 +213,14 @@ endif() include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) if(MINGW) - set(Boost_LIBRARIES "${Boost_LIBRARIES};pthread;mswsock;ws2_32") + set(EXTRA_LIBRARIES pthread;mswsock;ws2_32) elseif(APPLE OR FREEBSD) - set(Boost_LIBRARIES "${Boost_LIBRARIES}") + set(EXTRA_LIBRARIES "") elseif(NOT MSVC) - #set(Boost_LIBRARIES "${Boost_LIBRARIES};rt;pthread") + find_library(RT rt) + find_library(PTHREAD pthread) + find_library(DL dl) + set(EXTRA_LIBRARIES ${RT} ${PTHREAD} ${DL}) endif() file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/version") @@ -215,15 +235,5 @@ else() add_custom_target(version ALL) endif() -add_subdirectory(external) - -# Final setup for miniupnpc -if(UPNP_STATIC) - add_definitions("-DUPNP_STATIC") -else() - add_definitions("-DUPNP_DYNAMIC") - include_directories(${UPNP_INCLUDE}) -endif() - add_subdirectory(src) add_subdirectory(tests) |