aboutsummaryrefslogtreecommitdiff
path: root/external/CMakeLists.txt
diff options
context:
space:
mode:
authorTheCharlatan <seb.kung@gmail.com>2018-03-20 01:26:35 +0100
committerTheCharlatan <seb.kung@gmail.com>2018-09-10 22:03:42 +0200
commit8db3d5731bc999983ca6c776731a26a4e97d8bc8 (patch)
tree827e31e63fce7f604de95d0951ef4c951b886bce /external/CMakeLists.txt
parentInitial depends addition (diff)
downloadmonero-8db3d5731bc999983ca6c776731a26a4e97d8bc8.tar.xz
Modify depends for monero's dependencies
Add readline, ldns, graphviz, unbound to depends packages Add a cmake toolchain file to depends that is uniquely created for every build and placed in triple/share/toolchain.cmake This file is then passed to cmake with -DCMAKE_TOOLCHAIN_FILE=/path/to/triple/share/toolchain.cmake Add the boost locale package to depends In the depends cmake toolchain file, a DEPENDS flag is added to exclude, or change cmake checks done that are required for depends Link miniupnpc and unwind from depends and not external Add libiconv and icu4c to depends, required for mingw32 builds. Headers (winsock) need to be lower case in order to compile on unix systems. This should not affect building on windows.
Diffstat (limited to '')
-rw-r--r--external/CMakeLists.txt46
1 files changed, 31 insertions, 15 deletions
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
index 1fc4d64c1..4757b2a3b 100644
--- a/external/CMakeLists.txt
+++ b/external/CMakeLists.txt
@@ -37,14 +37,18 @@
find_package(Miniupnpc REQUIRED)
-message(STATUS "Using in-tree miniupnpc")
-
-add_subdirectory(miniupnp/miniupnpc)
-
-set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external")
+if(DEPENDS)
+ message(STATUS "Using static depends miniupnpc found at ${MINIUPNP_LIBRARIES}")
+ set(UPNP_STATIC true PARENT_SCOPE)
+ set(UPNP_LIBRARIES ${MINIUPNP_LIBRARY} PARENT_SCOPE)
+else()
+ message(STATUS "Using in-tree miniupnpc")
+ add_subdirectory(miniupnp/miniupnpc)
+ set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external")
+endif()
if(MSVC)
set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267")
-elseif(NOT MSVC)
+elseif(NOT MSVC AND NOT DEPENDS)
set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value")
endif()
@@ -52,7 +56,7 @@ set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE)
find_package(Unbound)
-if(NOT UNBOUND_INCLUDE_DIR OR STATIC)
+if(NOT UNBOUND_INCLUDE_DIR OR STATIC AND NOT DEPENDS)
# NOTE: If STATIC is true, CMAKE_FIND_LIBRARY_SUFFIXES has been reordered.
# unbound has config tests which used OpenSSL libraries, so -ldl may need to
# be set in this case.
@@ -65,15 +69,27 @@ if(NOT UNBOUND_INCLUDE_DIR OR STATIC)
set(UNBOUND_LIBRARY "unbound" PARENT_SCOPE)
set(UNBOUND_LIBRARY_DIRS "${LIBEVENT2_LIBDIR}" PARENT_SCOPE)
else()
- message(STATUS "Found libunbound include (unbound.h) in ${UNBOUND_INCLUDE_DIR}")
- if(UNBOUND_LIBRARIES)
- message(STATUS "Found libunbound shared library")
- set(UNBOUND_STATIC false PARENT_SCOPE)
- set(UNBOUND_INCLUDE ${UNBOUND_INCLUDE_DIR} PARENT_SCOPE)
- set(UNBOUND_LIBRARY ${UNBOUND_LIBRARIES} PARENT_SCOPE)
- set(UNBOUND_LIBRARY_DIRS "" PARENT_SCOPE)
+ if(DEPENDS)
+ message(STATUS "Found libunbound include (unbound.h) in ${UNBOUND_INCLUDE_DIR}")
+ if(UNBOUND_LIBRARIES)
+ message(STATUS "Found libunbound library in ${UNBOUND_LIBRARIES}")
+ set(UNBOUND_STATIC true PARENT_SCOPE)
+ set(UNBOUND_LIBRARY ${UNBOUND_LIBRARIES} PARENTSCOPE)
+ set(UNBOUND_LIBRARY_DIRS "" PARENT_SCOPE)
+ else()
+ die("Found libunbound includes, but could not find libunbound library. Please make sure you have installed libunbound or libunbound-dev or the equivalent")
+ endif()
else()
- die("Found libunbound includes, but could not find libunbound library. Please make sure you have installed libunbound or libunbound-dev or the equivalent")
+ message(STATUS "Found libunbound include (unbound.h) in ${UNBOUND_INCLUDE_DIR}")
+ if(UNBOUND_LIBRARIES)
+ message(STATUS "Found libunbound shared library")
+ set(UNBOUND_STATIC false PARENT_SCOPE)
+ set(UNBOUND_INCLUDE ${UNBOUND_INCLUDE_DIR} PARENT_SCOPE)
+ set(UNBOUND_LIBRARY ${UNBOUND_LIBRARIES} PARENT_SCOPE)
+ set(UNBOUND_LIBRARY_DIRS "" PARENT_SCOPE)
+ else()
+ die("Found libunbound includes, but could not find libunbound library. Please make sure you have installed libunbound or libunbound-dev or the equivalent")
+ endif()
endif()
endif()