diff --git a/CMakeLists.txt b/CMakeLists.txt index 56e935eb..154ea52e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 --------------------------------------------------------- -find_package(OpenMP) -if (OpenMP_FOUND) - add_definitions(-DHAVE_GOMP) -endif (OpenMP_FOUND) +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("") -message(" Qt found in ${Qt5Core_INCLUDE_DIRS} (Version: ${Qt5Core_VERSION})") +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(" ---------") diff --git a/src/classes/CMakeLists.txt b/src/classes/CMakeLists.txt index 6d4f952d..619d9864 100644 --- a/src/classes/CMakeLists.txt +++ b/src/classes/CMakeLists.txt @@ -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) diff --git a/src/external/MuSR_software/Class_MuSR_PSI/CMakeLists.txt b/src/external/MuSR_software/Class_MuSR_PSI/CMakeLists.txt index 122feb9b..0c5d59d4 100644 --- a/src/external/MuSR_software/Class_MuSR_PSI/CMakeLists.txt +++ b/src/external/MuSR_software/Class_MuSR_PSI/CMakeLists.txt @@ -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)