diff --git a/CMakeLists.txt b/CMakeLists.txt index beb8141ad9689fadb6f62395acdffa6718164cb9..9215420345da586c296658a2a617844fb37b2bd4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,9 @@ endif() # --------------------------------------------------------------------- # ITK +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + add_definitions(-DVCL_CAN_STATIC_CONST_INIT_FLOAT=0 -DVCL_CAN_STATIC_CONST_INIT_INT=0) +endif() find_package( ITK REQUIRED ) include( ${ITK_USE_FILE} ) @@ -34,6 +37,16 @@ include( "${CMAKE_CURRENT_SOURCE_DIR}/CMake/elxITKRequiredModules.cmake" ) find_package( Boost ) include_directories( ${Boost_INCLUDE_DIRS} ) +# --------------------------------------------------------------------- +# OpenMP Library +# Required for ElastixComponent +# gcc needs the appropriate flags to support OpenMP +find_package(OpenMP) +if (OPENMP_FOUND) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") +endif() + # --------------------------------------------------------------------- # Build SuperElastix # For now we just enable all modules