diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index afcb956..ad77e19 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -177,7 +177,7 @@ set(USCXML_INCLUDE_DIRS) # some compiler flags #message("CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}") -if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) # best practices from scott meyers @@ -225,7 +225,7 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") else() add_definitions(-rdynamic) endif() -elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") +elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") add_definitions("-DZMQ_STATIC") add_definitions("-DPCRE_STATIC") add_definitions("-DUMUNDO_STATIC") @@ -235,7 +235,7 @@ elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") # SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB") # SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:MSVCRTD.lib") -elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") +elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-parentheses-equality") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-string-plus-int") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-non-literal-null-conversion") @@ -384,16 +384,21 @@ if (V8_FOUND) endif() set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) -find_package(GMP) find_package(SWI) -find_package(CURSES) -if (SWI_FOUND AND GMP_FOUND AND CURSES_FOUND) +if (SWI_FOUND) include_directories(${SWI_INCLUDE_DIR}) - include_directories(${GMP_INCLUDE_DIR}) - include_directories(${CURSES_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${SWI_LIBRARY} ${GMP_LIBRARY} ${CURSES_LIBRARIES}) -else() - set(SWI_FOUND OFF) + if (BUILD_PREFER_STATIC_LIBRARIES) + find_package(GMP) + find_package(Curses) + if (GMP_FOUND AND CURSES_FOUND) + list (APPEND USCXML_OPT_LIBS ${SWI_LIBRARY} ${GMP_LIBRARY} ${CURSES_LIBRARIES}) + else() + message("Not building datamodel with static SWI without NCurses and GMP") + set(SWI_FOUND OFF) + endif() + else() + list (APPEND USCXML_OPT_LIBS ${SWI_LIBRARY}) + endif() endif() set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_STATIC}) |