summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdoardo Pasca <edo.paskino@gmail.com>2018-02-06 16:52:33 +0000
committerEdoardo Pasca <edo.paskino@gmail.com>2018-02-06 16:52:33 +0000
commit7eba2d792ff9336617c229d07ef545dd0b5918b8 (patch)
tree1421cd42053d6ee903b524c062834ae9599a3155
parent75df6a93bf883a66005e65f2d98fa1fe1ba3ed4a (diff)
downloadregularization-7eba2d792ff9336617c229d07ef545dd0b5918b8.tar.gz
regularization-7eba2d792ff9336617c229d07ef545dd0b5918b8.tar.bz2
regularization-7eba2d792ff9336617c229d07ef545dd0b5918b8.tar.xz
regularization-7eba2d792ff9336617c229d07ef545dd0b5918b8.zip
compile with OpenMP works on Windows
-rw-r--r--Core/CMakeLists.txt20
1 files changed, 17 insertions, 3 deletions
diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt
index 070b45c..263b35c 100644
--- a/Core/CMakeLists.txt
+++ b/Core/CMakeLists.txt
@@ -33,7 +33,14 @@ if (Boost_FOUND)
message("Boost library dir " ${Boost_LIBRARY_DIRS})
message("Boost libraries " ${Boost_LIBRARIES})
endif()
-
+
+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}")
+ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
+endif()
+
## Build the regularizers package as a library
message("Creating Regularizers as shared library")
@@ -42,7 +49,9 @@ message("CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}")
set(CMAKE_BUILD_TYPE "Release")
if(WIN32)
- set (FLAGS "/DWIN32 /EHsc /DBOOST_ALL_NO_LIB /openmp /DCCPiCore_EXPORTS")
+ set (FLAGS "/DWIN32 /EHsc /DBOOST_ALL_NO_LIB /DCCPiCore_EXPORTS /openmp")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}")
+ set (CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:MSVCRT.lib")
set (EXTRA_LIBRARIES
@@ -53,7 +62,10 @@ if(WIN32)
message("library lib: ${LIBRARY_LIB}")
elseif(UNIX)
- set (FLAGS "-fopenmp -O2 -funsigned-char -Wall -Wl,--no-undefined -DCCPiReconstructionIterative_EXPORTS -std=c++0x")
+ set (FLAGS "-O2 -funsigned-char -Wall -Wl,--no-undefined -DCCPiReconstructionIterative_EXPORTS -std=c++0x")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}")
+ set (CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}")
+
set (EXTRA_LIBRARIES
${Boost_LIBRARIES}
#"tiff"
@@ -61,6 +73,8 @@ elseif(UNIX)
)
endif()
+message("CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}")
+
## Build the regularizers package as a library
message("Adding regularizers as shared library")