]> Creatis software - creaMaracasVisu.git/commitdiff
#3489 OpenMP MacOs
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Wed, 3 Aug 2022 11:10:21 +0000 (13:10 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Wed, 3 Aug 2022 11:10:21 +0000 (13:10 +0200)
CMakeLists.txt
bbtk/CMakeLists.txt
lib/maracasVisuLib/CMakeLists.txt

index 9177c10c91ce467604e7e0d4c44fda0fc0cca64a..e8da28b2bfd05031f7e3829b5d06383a55838218 100644 (file)
@@ -74,11 +74,12 @@ ENDIF(crea_FOUND)
 
 CREA_PREVENT_IN_SOURCE_BUILD()
 
-#SET(USE_GDCM ON)
-#SET(USE_GDCM_VTK ON)
-SET(USE_WXWIDGETS ON)
-SET(USE_VTK ON)
-SET(USE_BOOST ON)
+#SET(USE_GDCM       ON)
+#SET(USE_GDCM_VTK   ON)
+SET(USE_WXWIDGETS   ON)
+SET(USE_VTK         ON)
+SET(USE_BOOST       ON)
+SET(USE_OPENMP      ON)
 
 OPTION(QT_USE_QTUITOOLS "QT_USE_QTUITOOLS" OFF)
 IF(QT_USE_QTUITOOLS)
@@ -167,31 +168,3 @@ ELSE(WIN32)
 ENDIF(WIN32)
 
 
-#.  ----  MacOs ---------
-#EED  /Library/Developer/CommandLineTools/usr/bin/c++ 
-#EED FLAGS C++ :      -Xpreprocessor -fopenmp
-#                      http://secomparteosepierde.blogspot.com/2019/04/how-to-install-openmp-on-mac-using.html
-#                       https://stackoverflow.com/questions/23554716/using-openmp-on-windows-with-mingw-cannot-find-lpthread
-#You need -Xpreprocessor flag to use -fopenmp flag
-#
-#  sudo port install libomp-devel   
-#  sudo port -f activate libomp-devel
-
-##. This cmake code is not working ??????   MacOs..
-
-message(STATUS "Checking OpenMP")
-find_package(OpenMP )
-if(OpenMP_CXX_FOUND)
-    message("OpenMP. Yessssssss")
-endif()
-IF(OPENMP_FOUND)
-    message("Found OpenMP! ^_^")
-    # add flags for OpenMP
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
-    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${OpenMP_SHARED_LINKER_FLAGS}")
-    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
-ELSE()
-    message("Missed OpenMP! :(")
-ENDIF()
-
index c150063609b13d24cff71022269388cd265122ca..9f65f2cd07db1f07c2a7bd98191d10c731628c4b 100644 (file)
@@ -382,12 +382,14 @@ SET(${BBTK_PACKAGE_NAME}_INCLUDE_DIRS
 ###  vtkgdcm
 #1)
 
-
 #===========================================================================
 SET(${BBTK_PACKAGE_NAME}_LIBS 
   # LIST HERE THE ADDITIONAL LIBS TO LINK AGAINST
   # EXCEPT : the same libs than for INCLUDE_DIRS 
 ###  ${MYSQL_LIBRARIES}
+
+  ${OpenMP_libomp_LIBRARY_crea}
+
   creaMaracasVisu
 
   BaseVolumeRenderer
@@ -404,6 +406,7 @@ SET(${BBTK_PACKAGE_NAME}_LIBS
 ###  ILPDInterface
 ###  ILPDcontrolerInterface
 
+
 )
 #===========================================================================
 
index d4896a4fce372c711f44b5d0a99de1ca535b2b8d..c3b3afcbb6b437ff6fabea9429881ed7daa78bd7 100644 (file)
@@ -153,8 +153,11 @@ IF ( BUILD_${LIBRARY_NAME} )
         ${WXWIDGETS_LIBRARIES}
         ${VTK_LIBRARIES}
         ${ITK_LIBRARIES}
-#        ${GDCM_LIBRARIES}
-    #    ${BOOST_LIBRARIES}
+#       ${GDCM_LIBRARIES}
+#       ${BOOST_LIBRARIES}
+        ${OpenMP_libomp_LIBRARY_crea}
+  
+    
        #jhcl-Start===========================================================================
                
                ${LIBIDO_LIBRARIES}