Commit 32d27b3a authored by Dominik Bongartz's avatar Dominik Bongartz
Browse files

Update CMakeLists.txt and submodules

parent 010f3e9e
......@@ -2,38 +2,49 @@ cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
message("Checking files for CLP.")
project(clp C CXX)
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
endif()
set(CLP_SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/Clp-1.17.0/Clp/src)
set(CLP_COINDIR ${CMAKE_CURRENT_SOURCE_DIR}/Clp-1.17.0/CoinUtils/src)
include(clpSourceFiles.cmake)
include(coinutilsSourceFiles.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/clpSourceFiles.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/coinutilsSourceFiles.cmake)
add_library(clp STATIC ${CLP_SOURCES} ${COINUTILS_SOURCES})
add_library(clp ${CLP_SOURCES} ${COINUTILS_SOURCES})
target_include_directories(clp
PUBLIC
${CLP_SRCDIR}
${CLP_COINDIR}
)
# Turn off warnings and turn on optimization and parallel compilation
target_compile_options(clp
PRIVATE
$<$<C_COMPILER_ID:MSVC>: /MP;/Qpar;/wd4141;/wd4068;/wd4018;/wd4244;/wd4267;/wd4065;/wd4102;/wd4101;/wd4805>
$<$<C_COMPILER_ID:Intel>: $<$<PLATFORM_ID:Windows>:/Qwd858> $<$<NOT:$<PLATFORM_ID:Windows>>:-wd858>>
$<$<C_COMPILER_ID:GNU>: -Wno-stringop-overflow -Wno-format-overflow>
$<$<C_COMPILER_ID:AppleClang>: -Wno-constant-logical-operand -Wno-deprecated-register -Wno-parentheses-equality -Wno-constant-conversion>
$<$<C_COMPILER_ID:Clang>: -Wno-constant-logical-operand -Wno-deprecated-register -Wno-parentheses-equality -Wno-constant-conversion>
)
if(NOT(MSVC))
)
set_target_properties(clp PROPERTIES DEBUG_POSTFIX d)
if(WIN32 AND BUILD_SHARED_LIBS)
set_target_properties(clp PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
if(MSVC)
target_compile_options(clp PRIVATE /MP;/Qpar)
else()
target_compile_options(clp
PRIVATE
$<$<C_COMPILER_ID:Intel>: $<$<NOT:$<CONFIG:DEBUG>>:-O3> $<$<CONFIG:DEBUG>:-O0>>
$<$<C_COMPILER_ID:GNU>: $<$<NOT:$<CONFIG:DEBUG>>:-O3> $<$<CONFIG:DEBUG>:-O0>>
$<$<C_COMPILER_ID:AppleClang>: $<$<NOT:$<CONFIG:DEBUG>>:-O3> $<$<CONFIG:DEBUG>:-O0>>
$<$<C_COMPILER_ID:Clang>: $<$<NOT:$<CONFIG:DEBUG>>:-O3> $<$<CONFIG:DEBUG>:-O0>>
)
)
endif()
target_compile_options(clp
PRIVATE
$<$<C_COMPILER_ID:MSVC>: /wd4141;/wd4068;/wd4018;/wd4244;/wd4267;/wd4065;/wd4102;/wd4101;/wd4805>
$<$<C_COMPILER_ID:Intel>: $<$<PLATFORM_ID:Windows>:/Qwd858> $<$<NOT:$<PLATFORM_ID:Windows>>:-wd858>>
$<$<C_COMPILER_ID:GNU>: -Wno-stringop-overflow -Wno-format-overflow>
$<$<C_COMPILER_ID:AppleClang>: -Wno-constant-logical-operand -Wno-deprecated-register -Wno-parentheses-equality -Wno-constant-conversion>
$<$<C_COMPILER_ID:Clang>: -Wno-constant-logical-operand -Wno-deprecated-register -Wno-parentheses-equality -Wno-constant-conversion>
)
target_compile_definitions(clp
PRIVATE
__BYTE_ORDER
......@@ -46,7 +57,7 @@ if(WIN32)
target_compile_definitions(clp
PRIVATE
NDEBUG # Since there is a portion of CLP code (which is compiled if NDEBUG is not defined) that uses usleep (which does not exist for windows), so we need to disable it
)
)
endif()
target_link_libraries(clp
PRIVATE
......@@ -70,7 +81,7 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
${PROJECT_SOURCE_DIR}/test/test.cpp
)
target_link_libraries(clp-test clp)
set_target_properties(clp-test PROPERTIES CXX_STANDARD 11)
target_compile_features(clp-test PRIVATE cxx_std_11)
endif()
......@@ -96,4 +107,4 @@ else()
endif()
include(clpConfig.cmake)
\ No newline at end of file
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/clpConfig.cmake)
\ No newline at end of file
......@@ -73,5 +73,5 @@ include(CheckFunctionExists)
check_function_exists(finite COIN_C_FINITE)
check_function_exists(std::isnan COIN_C_ISNAN)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configHclp.h.in ${CLP_SRCDIR}/config.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configHcoinutils.h.in ${CLP_COINDIR}/config.h)
\ No newline at end of file
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/configHclp.h.in ${CLP_SRCDIR}/config.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/configHcoinutils.h.in ${CLP_COINDIR}/config.h)
\ No newline at end of file
Subproject commit 10411bb27820924be3e2e32f14cdaa70864ea84d
Subproject commit bbfd6ffc3f62e47f24dd8834300e3b19e5d059a4
Subproject commit 39be3fb59ae4b1a3be4446635b07fbc82098ac92
Subproject commit 2f98a19432ea36b58aa407544b23583364368bbb
Subproject commit 8a8161e2f5b667bde2fdc8eaa4a0c73a8e9ea3c6
Subproject commit 8cb3916c0898a576652f7ff39652039f9bc62d74
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment