2019-07-16 20:19:11 -06:00
|
|
|
# list depends here.
|
2012-03-13 07:46:48 -06:00
|
|
|
add_subdirectory(lua)
|
|
|
|
add_subdirectory(md5)
|
|
|
|
add_subdirectory(protobuf)
|
2016-06-26 17:48:55 -06:00
|
|
|
|
|
|
|
# Don't build tinyxml if it's being externally linked against.
|
|
|
|
if(NOT TinyXML_FOUND)
|
|
|
|
add_subdirectory(tinyxml)
|
|
|
|
endif()
|
|
|
|
|
2012-03-13 07:46:48 -06:00
|
|
|
add_subdirectory(tthread)
|
2019-07-16 20:19:11 -06:00
|
|
|
option(JSONCPP_WITH_TESTS "Compile and (for jsoncpp_check) run JsonCpp test executables" OFF)
|
|
|
|
option(JSONCPP_WITH_POST_BUILD_UNITTEST "Automatically run unit-tests as a post build step" OFF)
|
2018-07-08 22:16:08 -06:00
|
|
|
add_subdirectory(jsoncpp-sub EXCLUDE_FROM_ALL)
|
2012-03-13 10:10:46 -06:00
|
|
|
# build clsocket static and only as a dependency. Setting those options here overrides its own default settings.
|
2019-07-16 20:19:11 -06:00
|
|
|
option(CLSOCKET_SHARED "Build clsocket lib as shared." OFF)
|
|
|
|
option(CLSOCKET_DEP_ONLY "Build for use inside other CMake projects as dependency." ON)
|
2012-03-13 10:10:46 -06:00
|
|
|
add_subdirectory(clsocket)
|
2019-07-16 20:19:11 -06:00
|
|
|
ide_folder(clsocket "Depends")
|
2020-08-08 16:24:12 -06:00
|
|
|
|
2020-08-08 23:42:50 -06:00
|
|
|
# assemble environment args to pass on to dependency projects
|
|
|
|
get_cmake_property(vars CACHE_VARIABLES)
|
|
|
|
foreach(var ${vars})
|
2020-08-09 01:24:25 -06:00
|
|
|
if(var MATCHES "^CMAKE_"
|
|
|
|
AND NOT var MATCHES "^CMAKE_CACHE"
|
|
|
|
AND NOT var MATCHES "^CMAKE_HOME"
|
|
|
|
AND NOT var MATCHES "^CMAKE_PROJECT")
|
|
|
|
list(APPEND CL_ARGS "-D${var}=${${var}}")
|
|
|
|
endif()
|
|
|
|
if(var MATCHES "^ZLIB")
|
2020-08-09 00:55:24 -06:00
|
|
|
list(APPEND CL_ARGS "-D${var}=${${var}}")
|
|
|
|
endif()
|
2020-08-08 23:42:50 -06:00
|
|
|
endforeach()
|
2020-08-09 01:24:25 -06:00
|
|
|
|
2020-08-09 09:54:42 -06:00
|
|
|
include(ExternalProject)
|
|
|
|
|
2020-08-09 01:24:25 -06:00
|
|
|
if(WIN32)
|
2020-08-10 02:01:13 -06:00
|
|
|
set(EXPAT_LIB_NAME_SUFFIX "MD")
|
2020-08-10 01:01:47 -06:00
|
|
|
set(XLSXIO_C_FLAGS "${CMAKE_C_FLAGS} /DXML_STATIC")
|
2020-08-09 01:24:25 -06:00
|
|
|
else()
|
2020-08-10 02:01:13 -06:00
|
|
|
set(EXPAT_LIB_NAME_SUFFIX "")
|
2020-08-10 01:01:47 -06:00
|
|
|
set(XLSXIO_C_FLAGS "${CMAKE_C_FLAGS} -DXML_STATIC")
|
2020-08-09 01:24:25 -06:00
|
|
|
endif()
|
2020-08-08 23:42:50 -06:00
|
|
|
|
2020-08-08 21:18:43 -06:00
|
|
|
set(LIBEXPAT_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/libexpat)
|
2020-08-10 02:01:13 -06:00
|
|
|
set(LIBEXPAT_LIB ${LIBEXPAT_INSTALL_DIR}/lib/libexpat${EXPAT_LIB_NAME_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
|
2020-08-09 03:24:05 -06:00
|
|
|
set(LIBEXPAT_LIB ${LIBEXPAT_LIB} PARENT_SCOPE)
|
2020-08-08 21:18:43 -06:00
|
|
|
ExternalProject_Add(libexpat_project
|
|
|
|
PREFIX libexpat
|
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libexpat/expat
|
|
|
|
INSTALL_DIR ${LIBEXPAT_INSTALL_DIR}
|
2020-08-09 03:24:05 -06:00
|
|
|
BUILD_BYPRODUCTS ${LIBEXPAT_LIB}
|
2020-08-09 03:32:31 -06:00
|
|
|
CMAKE_ARGS ${CL_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBEXPAT_INSTALL_DIR} -DCMAKE_BUILD_TYPE=Release -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF -DEXPAT_BUILD_TOOLS=OFF -DEXPAT_SHARED_LIBS=OFF -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
2020-08-08 21:18:43 -06:00
|
|
|
)
|
|
|
|
|
2020-08-08 21:04:46 -06:00
|
|
|
set(LIBZIP_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/libzip)
|
2020-08-10 02:01:13 -06:00
|
|
|
set(LIBZIP_LIB ${LIBZIP_INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}zip${CMAKE_STATIC_LIBRARY_SUFFIX})
|
2020-08-09 03:24:05 -06:00
|
|
|
set(LIBZIP_LIB ${LIBZIP_LIB} PARENT_SCOPE)
|
2020-08-08 21:04:46 -06:00
|
|
|
ExternalProject_Add(libzip_project
|
|
|
|
PREFIX libzip
|
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libzip
|
|
|
|
INSTALL_DIR ${LIBZIP_INSTALL_DIR}
|
2020-08-09 03:24:05 -06:00
|
|
|
BUILD_BYPRODUCTS ${LIBZIP_LIB}
|
2020-08-09 03:32:31 -06:00
|
|
|
CMAKE_ARGS ${CL_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBZIP_INSTALL_DIR} -DCMAKE_BUILD_TYPE=Release -DBUILD_DOC=OFF -DBUILD_EXAMPLES=OFF -DBUILD_REGRESS=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TOOLS=OFF -DENABLE_BZIP2=OFF -DENABLE_COMMONCRYPTO=OFF -DENABLE_GNUTLS=OFF -DENABLE_LZMA=OFF -DENABLE_MBEDTLS=OFF -DENABLE_OPENSSL=OFF -DENABLE_WINDOWS_CRYPTO=OFF -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
2020-08-08 21:04:46 -06:00
|
|
|
)
|
|
|
|
|
2020-08-08 16:24:12 -06:00
|
|
|
set(XLSXIO_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/xlsxio)
|
2020-08-09 03:24:05 -06:00
|
|
|
set(XLSXIO_INSTALL_DIR ${XLSXIO_INSTALL_DIR} PARENT_SCOPE)
|
2020-08-10 02:01:13 -06:00
|
|
|
set(XLSXIO_LIB ${XLSXIO_INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}xlsxio_read${CMAKE_STATIC_LIBRARY_SUFFIX})
|
2020-08-09 03:24:05 -06:00
|
|
|
set(XLSXIO_LIB ${XLSXIO_LIB} PARENT_SCOPE)
|
2020-08-08 16:24:12 -06:00
|
|
|
ExternalProject_Add(xlsxio_project
|
|
|
|
PREFIX xlsxio
|
2020-08-09 22:22:17 -06:00
|
|
|
DEPENDS libexpat_project libzip_project
|
2020-08-08 16:24:12 -06:00
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/xlsxio
|
|
|
|
INSTALL_DIR ${XLSXIO_INSTALL_DIR}
|
2020-08-09 03:24:05 -06:00
|
|
|
BUILD_BYPRODUCTS ${XLSXIO_LIB}
|
2020-08-10 01:01:47 -06:00
|
|
|
CMAKE_ARGS ${CL_ARGS} -DCMAKE_INSTALL_PREFIX=${XLSXIO_INSTALL_DIR} -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC=ON -DBUILD_SHARED=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_TOOLS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_DOCUMENTATION=OFF -DWITH_LIBZIP=ON -DZLIB_DIR=${ZLIB_DIR} -DLIBZIP_DIR=${LIBZIP_INSTALL_DIR} -DEXPAT_DIR=${LIBEXPAT_INSTALL_DIR} -DEXPAT_LIBRARIES=${LIBEXPAT_LIB} -DEXPAT_INCLUDE_DIRS=${LIBEXPAT_INSTALL_DIR}/include -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_C_FLAGS=${XLSXIO_C_FLAGS}
|
2020-08-08 16:24:12 -06:00
|
|
|
)
|