some first cmake tuning for macOS.

This commit is contained in:
suter_a 2018-05-05 16:47:11 +02:00
parent 42086350e7
commit 9bf47a2690
3 changed files with 32 additions and 6 deletions

View File

@ -9,6 +9,7 @@ option(ASlibs "build optional ASlibs" OFF)
option(BMWlibs "build optional BMWlibs" OFF)
option(BNMRlibs "build optional beta-NMR libs" OFF)
option(qt_based_tools "try to install Qt based tools (musredit, musrWiz, musrStep, mupp)" ON)
option(try_OpenMP "try to use OpenMP if available" ON)
#--- check for all the needed packages ----------------------------------------
@ -43,10 +44,12 @@ find_package(FFTW3 REQUIRED)
find_package(LibXml2 REQUIRED)
#--- check for OpenMP ---------------------------------------------------------
if (try_OpenMP)
find_package(OpenMP)
if (OpenMP_FOUND)
add_definitions(-DHAVE_GOMP)
endif (OpenMP_FOUND)
endif (try_OpenMP)
#--- check for Qt -------------------------------------------------------------
if (qt_based_tools)
@ -107,6 +110,9 @@ message(" GSL found in ${GSL_INCLUDE_DIRS}")
message(" BOOST found in ${Boost_INCLUDE_DIRS}")
message(" LibXML2 found in ${LIBXML2_INCLUDE_DIR}")
message(" ROOT found in ${ROOT_INCLUDE_DIRS}")
if (OpenMP_FOUND)
message(" OpenMP found (version ${OpenMP_VERSION})")
endif (OpenMP_FOUND)
if (nexus)
message("")
@ -121,7 +127,19 @@ if (BMWlibs)
endif (BMWlibs)
message("")
if (qt_based_tools)
if (Qt5Core_FOUND)
message(" Qt found in ${Qt5Core_INCLUDE_DIRS} (Version: ${Qt5Core_VERSION})")
else (Qt5Core_FOUND)
if (Qt4_FOUND)
message(" Qt found in ${Qt4_INCLUDE_DIRS} (Version: ${Qt4_VERSION})")
else (Qt4_FOUND)
if (QT_FOUND)
message(" Qt found in ${QT_INCLUDE_DIRS} (Version: ${QT_VERSION})")
endif (QT_FOUND)
endif (Qt4_FOUND)
endif (Qt5Core_FOUND)
endif (qt_based_tools)
message("")
message(" Features:")
message(" ---------")

View File

@ -106,7 +106,6 @@ if (nexus)
set(DependOnLibs ${DependOnLibs} ${LIBNEXUS_LIBRARY})
set(DependOnLibs ${DependOnLibs} PNeXus)
endif (nexus)
message("debug> OpenMP_FOUND: ${OpenMP_FOUND}, libs: ${OpenMP_CXX_LIBRARIES}")
if (OpenMP_FOUND)
set(DependOnLibs ${DependOnLibs} ${OpenMP_CXX_LIBRARIES})
endif (OpenMP_FOUND)

View File

@ -9,6 +9,15 @@ set(PSIBIN_VERSION "0.1.0")
set(PSIBIN_LIBRARY_NAME "Class_MuSR_PSI")
configure_file("Class_MuSR_PSI.pc.in" "Class_MuSR_PSI.pc" @ONLY)
#--- OS dependent pre-compiler settings for PSI-BIN ---------------------------
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
add_definitions(-D__linux__)
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
add_definitions(-D_Darwin_)
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
add_definitions(-D_WIN32)
endif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
#--- lib creation -------------------------------------------------------------
add_library(Class_MuSR_PSI SHARED MuSR_td_PSI_bin.cpp)