diff --git a/coloquinte/CMakeLists.txt b/coloquinte/CMakeLists.txt index a773e8b2..4e435671 100644 --- a/coloquinte/CMakeLists.txt +++ b/coloquinte/CMakeLists.txt @@ -19,7 +19,11 @@ find_package(Libexecinfo REQUIRED) if(WITH_OPENMP) - add_definitions( -fopenmp ) + find_package(OpenMP REQUIRED) + add_definitions(${OpenMP_CXX_FLAGS}) + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}") endif() add_subdirectory(src) diff --git a/unicorn/CMakeLists.txt b/unicorn/CMakeLists.txt index 9d9623e6..e1d61a7f 100644 --- a/unicorn/CMakeLists.txt +++ b/unicorn/CMakeLists.txt @@ -33,7 +33,15 @@ find_package(KITE REQUIRED) #find_package(EQUINOX REQUIRED) #find_package(SOLSTICE REQUIRED) - + + if(WITH_OPENMP) + find_package(OpenMP REQUIRED) + add_definitions(${OpenMP_CXX_FLAGS}) + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}") + endif(WITH_OPENMP) + add_subdirectory(src) add_subdirectory(python) add_subdirectory(cmake_modules)