diff CMakeLists.txt @ 2366:26f3a346226f

more consistent handling of libiconv in cmake
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 21 Aug 2017 21:21:48 +0200
parents 25a15aae0d74
children 2aff870c2c58
line wrap: on
line diff
--- a/CMakeLists.txt	Mon Aug 21 17:15:51 2017 +0200
+++ b/CMakeLists.txt	Mon Aug 21 21:21:48 2017 +0200
@@ -43,6 +43,7 @@
 SET(USE_SYSTEM_LUA ON CACHE BOOL "Use the system version of Lua")
 SET(USE_SYSTEM_DCMTK ON CACHE BOOL "Use the system version of DCMTK")
 SET(USE_SYSTEM_BOOST ON CACHE BOOL "Use the system version of Boost")
+SET(USE_SYSTEM_LIBICONV ON CACHE BOOL "Use the system version of libiconv")
 SET(USE_SYSTEM_LIBPNG ON CACHE BOOL "Use the system version of libpng")
 SET(USE_SYSTEM_LIBJPEG ON CACHE BOOL "Use the system version of libjpeg")
 SET(USE_SYSTEM_CURL ON CACHE BOOL "Use the system version of LibCurl")
@@ -74,6 +75,7 @@
 # Some basic inclusions
 include(CheckIncludeFiles)
 include(CheckIncludeFileCXX)
+include(CheckFunctionExists)
 include(CheckLibraryExists)
 include(FindPythonInterp)
 include(${CMAKE_SOURCE_DIR}/Resources/CMake/AutoGeneratedCode.cmake)
@@ -303,6 +305,7 @@
 include(${CMAKE_SOURCE_DIR}/Resources/CMake/SQLiteConfiguration.cmake)
 include(${CMAKE_SOURCE_DIR}/Resources/CMake/ZlibConfiguration.cmake)
 include(${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleTestConfiguration.cmake)
+include(${CMAKE_SOURCE_DIR}/Resources/CMake/LibIconvConfiguration.cmake)
 
 # These are the two most heavyweight dependencies. We put them as the
 # last includes to quickly spot problems when configuring static
@@ -466,14 +469,15 @@
   ${BOOST_SOURCES}
   ${CURL_SOURCES}
   ${JSONCPP_SOURCES}
+  ${LIBICONV_SOURCES}
+  ${LIBJPEG_SOURCES}
+  ${LIBP11_SOURCES}
   ${LIBPNG_SOURCES}
-  ${LIBJPEG_SOURCES}
   ${LUA_SOURCES}
   ${MONGOOSE_SOURCES}
   ${PUGIXML_SOURCES}
   ${SQLITE_SOURCES}
   ${ZLIB_SOURCES}
-  ${LIBP11_SOURCES}
 
   ${CMAKE_SOURCE_DIR}/Resources/ThirdParty/md5/md5.c
   ${CMAKE_SOURCE_DIR}/Resources/ThirdParty/base64/base64.cpp
@@ -557,6 +561,7 @@
   add_library(ServeFolders SHARED 
     ${BOOST_SOURCES}
     ${JSONCPP_SOURCES}
+    ${LIBICONV_SOURCES}
     Plugins/Samples/ServeFolders/Plugin.cpp
     Plugins/Samples/Common/OrthancPluginCppWrapper.cpp
     ${SERVE_FOLDERS_RESOURCES}
@@ -601,6 +606,7 @@
   add_library(ModalityWorklists SHARED 
     ${BOOST_SOURCES}
     ${JSONCPP_SOURCES}
+    ${LIBICONV_SOURCES}
     Plugins/Samples/Common/OrthancPluginCppWrapper.cpp
     Plugins/Samples/ModalityWorklists/Plugin.cpp
     ${MODALITY_WORKLISTS_RESOURCES}