diff --git a/Base/CMakeLists.txt b/Base/CMakeLists.txt index 2572bde69e13446e6594e418a409842b4198bbf9..9a2792d6913ec2c1fa12bc6ae3b3776fb128f5d9 100644 --- a/Base/CMakeLists.txt +++ b/Base/CMakeLists.txt @@ -24,27 +24,32 @@ target_include_directories(${lib} PUBLIC ${CMAKE_SOURCE_DIR} ${GSL_INCLUDE_DIR} ${FFTW3_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} SYSTEM PUBLIC ${EIGEN3_INCLUDE_DIRS} ) -target_link_libraries(${lib} ${GSL_LIBRARIES} ${FFTW3_LIBRARIES} ${Boost_LIBRARIES}) +target_link_libraries(${lib} + PRIVATE + ${GSL_LIBRARIES} + ${FFTW3_LIBRARIES} + ${Boost_LIBRARIES} + ${Boost_Additional_Libraries}) # g++ versions less than 9.1 need to link against libstdc++fs # if std::filesystem is used if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1) - target_link_libraries(${lib} stdc++fs) + target_link_libraries(${lib} PRIVATE stdc++fs) endif() # the same applies to clang versions less than 9.0: they need to link # against libstdc++fs or libc++fs if std::filesystem is used if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") - target_link_libraries(${lib} stdc++fs) + target_link_libraries(${lib} PRIVATE stdc++fs) else() - target_link_libraries(${lib} c++fs) + target_link_libraries(${lib} PRIVATE c++fs) endif() endif() if(BORNAGAIN_MPI) add_definitions(-DBORNAGAIN_MPI) include_directories(${MPI_INCLUDE_PATH}) - target_link_libraries(${lib} ${MPI_LIBRARIES}) + target_link_libraries(${lib} PRIVATE ${MPI_LIBRARIES}) endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e81f969048495b8afa1575c9facc1e3bfa0786b..3f5c764962df58ef064313172fb60afafcf90567 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,21 @@ project(BornAgain set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 17) +## Show info about generator type; set CMAKE_BUILD_TYPE if not given +if (CMAKE_CONFIGURATION_TYPES) + message(STATUS "Generator type: Multi-configuration generator") +else() + message(STATUS "Generator type: Single-configuration generator") +endif() +message(" CMAKE_CONFIGURATION_TYPES: ${CMAKE_CONFIGURATION_TYPES}") +# The following is not correct/does not have any effect for multi-configuration generators. +# But when correcting this, be aware that CMAKE_BUILD_TYPE is used in more scripts! +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release CACHE STRING "" FORCE) + message(" CMAKE_BUILD_TYPE type not given - forced to 'Release'") +endif() +message(" CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") + include(CTest) # equivalent to "enable_testing() ??? add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -LE Fullcheck) # => 'make check' is an alias for 'ctest' diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index 635132511ffdc34debcb856aa87013f0c60e37da..728a3b6fac17fe9c9d67e8f2546095c8a9c540d6 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -18,10 +18,14 @@ set(${lib}_LIBRARY ${lib} PARENT_SCOPE) # --- external dependencies --- -target_link_libraries(${lib} +target_link_libraries(${lib} + PUBLIC ${BornAgainSample_LIBRARY} ${BornAgainDevice_LIBRARY} - ${CMAKE_THREAD_LIBS_INIT}) + PRIVATE + ${CMAKE_THREAD_LIBS_INIT} + ${tspectrum_LIBRARY} + ${Cerf_LIBRARIES}) target_include_directories(${lib} PUBLIC ${CMAKE_SOURCE_DIR} @@ -29,11 +33,9 @@ target_include_directories(${lib} ${Cerf_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/3rdparty/Core/ # TEMPORARY ) -target_link_libraries(${lib} - ${tspectrum_LIBRARY} ${Cerf_LIBRARIES}) if(BORNAGAIN_MPI) add_definitions(-DBORNAGAIN_MPI) include_directories(${MPI_INCLUDE_PATH}) - target_link_libraries(${lib} ${MPI_LIBRARIES}) + target_link_libraries(${lib} PUBLIC ${MPI_LIBRARIES}) endif() diff --git a/Device/CMakeLists.txt b/Device/CMakeLists.txt index 40a89034bfb97940e3023e2537429cbbf5bdb1d6..123d6209a2ef18a6316eb3176098bac7e063a14d 100644 --- a/Device/CMakeLists.txt +++ b/Device/CMakeLists.txt @@ -18,10 +18,14 @@ set(${lib}_LIBRARY ${lib} PARENT_SCOPE) # --- external dependencies --- -target_link_libraries(${lib} +target_link_libraries(${lib} + PUBLIC ${BornAgainSample_LIBRARY} # TODO get rid of this dependence ${BornAgainParam_LIBRARY} - ${CMAKE_THREAD_LIBS_INIT}) + ${CMAKE_THREAD_LIBS_INIT} + PRIVATE + ${FFTW3_LIBRARIES}) + target_include_directories(${lib} PUBLIC ${CMAKE_SOURCE_DIR} ) @@ -30,7 +34,7 @@ target_include_directories(${lib} PUBLIC ${CMAKE_SOURCE_DIR} ${tspectrum_INCLUDE_DIR} ) -target_link_libraries(${lib} +target_link_libraries(${lib} PUBLIC ${tspectrum_LIBRARY} ) @@ -40,5 +44,5 @@ endif() if(BORNAGAIN_TIFF_SUPPORT) target_compile_definitions(${lib} PUBLIC -DBORNAGAIN_TIFF_SUPPORT) target_include_directories(${lib} PUBLIC ${TIFF_INCLUDE_DIR}) - target_link_libraries(${lib} ${TIFF_LIBRARIES}) + target_link_libraries(${lib} PUBLIC ${TIFF_LIBRARIES}) endif() diff --git a/Fit/3rdparty/RootMinimizers/CMakeLists.txt b/Fit/3rdparty/RootMinimizers/CMakeLists.txt index f7529311fb2f136ce8cebe0635601bdbb0e06e00..937c1f89e7a4d2d715ba3ea0c066b11013151173 100644 --- a/Fit/3rdparty/RootMinimizers/CMakeLists.txt +++ b/Fit/3rdparty/RootMinimizers/CMakeLists.txt @@ -38,7 +38,7 @@ add_library(${library_name} STATIC ${source_files}) target_include_directories(${library_name} PUBLIC ${include_dirs} ${GSL_INCLUDE_DIR} ${Boost_INCLUDE_DIRS}) -target_link_libraries(${library_name} ${GSL_LIBRARIES} ${Boost_LIBRARIES}) +target_link_libraries(${library_name} ${GSL_LIBRARIES} ${Boost_LIBRARIES} ${Boost_Additional_Libraries}) set(${library_name}_INCLUDE_DIRS ${include_dirs} CACHE INTERNAL "") set(${library_name}_LIBRARY ${library_name} CACHE INTERNAL "") diff --git a/Fit/CMakeLists.txt b/Fit/CMakeLists.txt index 69323b661196b7a44098d2c9e3fc9988a543d10d..68708ffb0da5f5bdfb0e33ed65214f2429cc01c6 100644 --- a/Fit/CMakeLists.txt +++ b/Fit/CMakeLists.txt @@ -20,4 +20,8 @@ set(${lib}_LIBRARY ${lib} PARENT_SCOPE) target_include_directories(${lib} PUBLIC ${RootMinimizers_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}) -target_link_libraries(${lib} ${RootMinimizers_LIBRARY} ${Boost_LIBRARIES}) +target_link_libraries(${lib} + PUBLIC + ${RootMinimizers_LIBRARY} + ${Boost_LIBRARIES} + ${Boost_Additional_Libraries}) diff --git a/GUI/CMakeLists.txt b/GUI/CMakeLists.txt index eb1ba2646fa19fc6a8ddf9dc65f36bc2dc41162e..2d89d55d0a93be79195adb6d5e77be3d9b6ea490 100644 --- a/GUI/CMakeLists.txt +++ b/GUI/CMakeLists.txt @@ -101,16 +101,20 @@ set(${library_name}_LIBRARY_TYPE SHARED) set(${library_name}_INCLUDE_DIRS ${include_dirs}) set(${library_name}_LIBRARY ${library_name}) +# --- switch OFF Qt debug output in any configuration except DEBUG +target_compile_definitions(${library_name} PUBLIC $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG_OUTPUT>) # --- dependencies --------- target_include_directories(${library_name} PUBLIC ${CMAKE_SOURCE_DIR}) target_link_libraries(${library_name} + PUBLIC ${BornAgainCore_LIBRARY} ${ba3d_LIBRARY} Qt5::Widgets Qt5::Core Qt5::Gui + PRIVATE Qt5::Designer Qt5::PrintSupport qcustomplot diff --git a/GUI/main/CMakeLists.txt b/GUI/main/CMakeLists.txt index 0e0300084e3f2e309a76f8105b627c1eacf6eccb..ccf31a9765ee04439149bf785b5a5000e6ec3cdd 100644 --- a/GUI/main/CMakeLists.txt +++ b/GUI/main/CMakeLists.txt @@ -42,8 +42,11 @@ add_executable(${executable_name} # ----------------------------------------------------------------------------- # dependencies # ----------------------------------------------------------------------------- -target_link_libraries(${executable_name} ${BornAgainGUI_LIBRARY}) -target_include_directories(${executable_name} PUBLIC ${BornAgainGUI_INCLUDE_DIRS}) +target_link_libraries(${executable_name} ${BornAgainGUI_LIBRARY} ${Boost_LIBRARIES}) +target_include_directories(${executable_name} + PUBLIC + ${BornAgainGUI_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS}) # ----------------------------------------------------------------------------- # extra target properties diff --git a/Param/CMakeLists.txt b/Param/CMakeLists.txt index cd62f879b5fc8bef3e200ae5022b75a531a1f742..e1e0d33863ef3b37840b73a5177794a09d91bc0b 100644 --- a/Param/CMakeLists.txt +++ b/Param/CMakeLists.txt @@ -19,6 +19,7 @@ set(${lib}_LIBRARY ${lib} PARENT_SCOPE) # --- external dependencies --- target_link_libraries(${lib} + PUBLIC ${BornAgainBase_LIBRARY} ${BornAgainFit_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) diff --git a/Sample/CMakeLists.txt b/Sample/CMakeLists.txt index f72133dfc7f61e9c1d3d29d8323b8f059b71a823..0d8f727fadea6542b97b8d49fc170ffda27f3bf0 100644 --- a/Sample/CMakeLists.txt +++ b/Sample/CMakeLists.txt @@ -19,6 +19,7 @@ set(${lib}_LIBRARY ${lib} PARENT_SCOPE) # --- external dependencies --- target_link_libraries(${lib} + PRIVATE ${BornAgainParam_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) target_include_directories(${lib} diff --git a/Tests/Functional/PyEmbedded/CMakeLists.txt b/Tests/Functional/PyEmbedded/CMakeLists.txt index dfcf617640697e58b21b861bf050534331b3a173..e42ea93cc8cf21e1be81c6db2cc49ef77f12b431 100644 --- a/Tests/Functional/PyEmbedded/CMakeLists.txt +++ b/Tests/Functional/PyEmbedded/CMakeLists.txt @@ -13,6 +13,6 @@ target_include_directories(${test} ${CMAKE_SOURCE_DIR}/auto/Wrap ) -target_link_libraries(${test} BornAgainCore gtest) +target_link_libraries(${test} BornAgainCore gtest ${Python3_LIBRARIES}) gtest_discover_tests(${test}) diff --git a/cmake/BornAgain/Compiler.cmake b/cmake/BornAgain/Compiler.cmake index d86a4eb6a53d6caa43e20fcfc0012ebb086f034b..4ca51e5a8b24fa4e6d2bba8d9baa118bd13a5959 100644 --- a/cmake/BornAgain/Compiler.cmake +++ b/cmake/BornAgain/Compiler.cmake @@ -1,15 +1,7 @@ #--------------------------------------------------------------------------------------------------- -# CheckCompiler.cmake +# Compiler.cmake #--------------------------------------------------------------------------------------------------- -#--- Set a default build type for single-configuration CMake generators if no build type is set --- - -if(NOT CMAKE_BUILD_TYPE) - # set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "" FORCE) - set(CMAKE_BUILD_TYPE Release CACHE STRING "" FORCE) -endif() -message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") - #--- Need to locate thead libraries and options to set properly some compilation flags --- find_package(Threads) @@ -18,17 +10,30 @@ find_package(Threads) message(STATUS "BornAgain Platform: ${BORNAGAIN_PLATFORM}") message(STATUS "BornAgain Architecture: ${BORNAGAIN_ARCHITECTURE}") -message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}") -set(all_cxx_flags ${CMAKE_CXX_FLAGS}) -if(CMAKE_BUILD_TYPE STREQUAL "Release") - string(APPEND all_cxx_flags " ${CMAKE_CXX_FLAGS_RELEASE}") -elseif(CMAKE_BUILD_TYPE STREQUAL "Debug") - string(APPEND all_cxx_flags " ${CMAKE_CXX_FLAGS_DEBUG}") -elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") - string(APPEND all_cxx_flags " ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") +message(STATUS "Default compiler flags (may be changed in later CMake steps):") +if (CMAKE_CONFIGURATION_TYPES) + if("Release" IN_LIST CMAKE_CONFIGURATION_TYPES) + message(" Release: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}") + endif() + if("Debug" IN_LIST CMAKE_CONFIGURATION_TYPES) + message(" Debug: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}") + endif() + if("RelWithDebInfo" IN_LIST CMAKE_CONFIGURATION_TYPES) + message(" RelWithDebInfo: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") + endif() + if("MinSizeRel" IN_LIST CMAKE_CONFIGURATION_TYPES) + message(" MinSizeRel: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_MINSIZEREL}") + endif() +else() + if(CMAKE_BUILD_TYPE STREQUAL "Release") + message(" ${CMAKE_BUILD_TYPE}: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}") + elseif(CMAKE_BUILD_TYPE STREQUAL "Debug") + message(" ${CMAKE_BUILD_TYPE}: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}") + elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") + message(" ${CMAKE_BUILD_TYPE}: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") + endif() endif() -message(STATUS "Compiler Flags: ${all_cxx_flags}") message(STATUS "Shared linker Flags: ${CMAKE_SHARED_LINKER_FLAGS}") message(STATUS "Exe linker Flags: ${CMAKE_EXE_LINKER_FLAGS}") diff --git a/cmake/BornAgain/Dependences.cmake b/cmake/BornAgain/Dependences.cmake index 477ac94a05cd7fff304391fa0a61fd016888084a..85438eb1a5fdd250e0f88c2c0c2f3a3c4730d949 100644 --- a/cmake/BornAgain/Dependences.cmake +++ b/cmake/BornAgain/Dependences.cmake @@ -48,8 +48,16 @@ if(NOT Boost_FOUND) endif() # requires these libs in target_link_libraries for win only +set(Boost_Additional_Libraries "") if(WIN32) - list(APPEND Boost_LIBRARIES ${BZIP2_LIBRARIES} ${ZLIB_LIBRARIES} ${LIBLZMA_LIBRARIES} ${ZSTD_LIBRARY}) + list(APPEND Boost_Additional_Libraries ${BZIP2_LIBRARIES} ${ZLIB_LIBRARIES} ${LIBLZMA_LIBRARIES} ${ZSTD_LIBRARY}) +endif() + +if(Boost_Additional_Libraries) + message(STATUS "Additional libraries required for Boost:") + foreach(lib ${Boost_Additional_Libraries}) + message(" ${lib}") + endforeach() endif() # === optional packages === @@ -127,44 +135,119 @@ endif() # === install Windows DLLs === if(WIN32) - # system libraries + ## Boost libraries + # The list ${Boost_LIBRARIES} can contain either only dll names (if e.g. debug dlls are + # not found), or keyword/dll pairs (if debug and release dlls have been found). This has + # to be taken care of in the iteration over the list. + # debug DLLs are ignored for installation + message(STATUS "Installation of Boost libraries:") + set(entryShallBeSkipped false) foreach(Boost_lib ${Boost_LIBRARIES}) + if (entryShallBeSkipped) + set(entryShallBeSkipped false) + continue() + endif() + + if (${Boost_lib} STREQUAL "debug") + set(entryShallBeSkipped true) + continue() + endif() + + if (${Boost_lib} STREQUAL "optimized") + set(entryShallBeSkipped false) + continue() + endif() + get_filename_component(UTF_BASE_NAME ${Boost_lib} NAME_WE) get_filename_component(UTF_PATH ${Boost_lib} PATH) - message(STATUS "Boost dll: ${UTF_PATH}/${UTF_BASE_NAME}.dll") install(FILES ${UTF_PATH}/${UTF_BASE_NAME}.dll - DESTINATION ${destination_lib} COMPONENT Libraries) + DESTINATION ${destination_lib} COMPONENT Libraries + CONFIGURATIONS [Release|MinSizeRel|RelWithDebInfo]) + message(" ${UTF_PATH}/${UTF_BASE_NAME}.dll - will be installed in ${destination_lib}") endforeach() + ## Libraries needed in addition (for boost) + message(STATUS "Installation of libraries needed in addition to Boost:") + foreach(lib ${Boost_Additional_Libraries}) + get_filename_component(UTF_BASE_NAME ${lib} NAME_WE) + get_filename_component(UTF_PATH ${lib} PATH) + install(FILES ${UTF_PATH}/${UTF_BASE_NAME}.dll + DESTINATION ${destination_lib} COMPONENT Libraries + CONFIGURATIONS [Release|MinSizeRel|RelWithDebInfo]) + message(" ${UTF_PATH}/${UTF_BASE_NAME}.dll - will be installed in ${destination_lib}") + endforeach() + + ## Python library set(win_python_lib "${Python3_LIBRARY_DIRS}/python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}.lib") get_filename_component(UTF_BASE_NAME ${win_python_lib} NAME_WE) get_filename_component(UTF_PATH ${Python3_EXECUTABLE} PATH) message(STATUS "Python dll: ${UTF_PATH}/${UTF_BASE_NAME}.dll" - " - installed in ${destination_lib}") + " - will be installed in ${destination_lib}") install(FILES ${UTF_PATH}/${UTF_BASE_NAME}.dll - DESTINATION ${destination_lib} COMPONENT Libraries) + DESTINATION ${destination_lib} COMPONENT Libraries + CONFIGURATIONS [Release|MinSizeRel|RelWithDebInfo]) + ## CERF library set(Cerf_LIB ${Cerf_LIBRARIES}) # we take for granted that there is only one cerf.lib get_filename_component(DIR ${Cerf_LIB} DIRECTORY) get_filename_component(cerf ${Cerf_LIB} NAME_WE) - set(DLL "${DIR}/cerfcpp.dll") - if (NOT EXISTS ${DLL}) - message(FATAL_ERROR "Dynamic link library ${DLL} (needed for cerf) does not exist") + set(Cerf_DLL "${DIR}/cerfcpp.dll") + if (NOT EXISTS ${Cerf_DLL}) + message(FATAL_ERROR "Dynamic link library ${Cerf_DLL} (needed for cerf) does not exist") endif() - install(FILES ${DLL} DESTINATION ${destination_lib} COMPONENT Libraries) - message(STATUS "Cerf dll: ${DLL} - installed in ${destination_lib}") - - set(DLL_MSG "") - foreach(LIB IN LISTS FFTW3_LIBRARIES TIFF_LIBRARIES) - string(REPLACE ".lib" ".dll" DLL "${LIB}") - if (NOT EXISTS ${DLL}) - message(FATAL_ERROR "Dynamic link library ${DLL} (derived from ${LIB}) does not exist") - endif() - install(FILES ${DLL} DESTINATION ${destination_lib} COMPONENT Libraries) - string(APPEND DLL_MSG " ${DLL}") + install(FILES ${Cerf_DLL} DESTINATION ${destination_lib} COMPONENT Libraries) + message(STATUS "Cerf dll: ${Cerf_DLL} - will be installed in ${destination_lib}") + + + ## FFTW3 + message(STATUS "Installation of FFTW3:") + foreach(lib ${FFTW3_LIBRARIES}) + get_filename_component(UTF_BASE_NAME ${lib} NAME_WE) + get_filename_component(UTF_PATH ${lib} PATH) + install(FILES ${UTF_PATH}/${UTF_BASE_NAME}.dll + DESTINATION ${destination_lib} COMPONENT Libraries + CONFIGURATIONS [Release|MinSizeRel|RelWithDebInfo]) + message(" ${UTF_PATH}/${UTF_BASE_NAME}.dll - will be installed in ${destination_lib}") endforeach() - message(STATUS "Other dlls: ${DLL_MSG} - installed in ${destination_lib}") + + ## TIFF + if (BORNAGAIN_TIFF_SUPPORT) + ## Same as for Boost above: list can contain + # mixture of debug/optimized libs + message(STATUS "Installation of TIFF:") + set(entryShallBeSkipped false) + foreach(LIB ${TIFF_LIBRARIES}) + if (entryShallBeSkipped) + set(entryShallBeSkipped false) + continue() + endif() + + if (${LIB} STREQUAL "debug") + set(entryShallBeSkipped true) + continue() + endif() + + if (${LIB} STREQUAL "optimized") + set(entryShallBeSkipped false) + continue() + endif() + + get_filename_component(UTF_NAME ${LIB} NAME) + if (${UTF_NAME} STREQUAL "tiff.lib") + message(" No installation for ${UTF_NAME}: This is the static TIFF library") + continue() + endif() + string(REPLACE ".lib" ".dll" DLL "${LIB}") + if (NOT EXISTS ${DLL}) + message(FATAL_ERROR "Dynamic link library ${DLL} (derived from ${LIB}) does not exist") + endif() + install(FILES ${DLL} COMPONENT Libraries + DESTINATION ${destination_lib} + CONFIGURATIONS [Release|MinSizeRel|RelWithDebInfo]) + message(" ${DLL} - will be installed in ${destination_lib}") + endforeach() + endif() endif(WIN32) diff --git a/cmake/BornAgain/Pack.cmake b/cmake/BornAgain/Pack.cmake index b5965ad84b345ed2b19326d139413a7fdc7d819b..ef5896e8fef38d016e53ead25be59d515cbb34f3 100644 --- a/cmake/BornAgain/Pack.cmake +++ b/cmake/BornAgain/Pack.cmake @@ -12,12 +12,6 @@ set(CPACK_PACKAGE_RELOCATABLE True) set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CMAKE_PROJECT_NAME}-${CMAKE_PROJECT_VERSION}) set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_SOURCE_PACKAGE_FILE_NAME}) -set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_INSTALL_DIRECTORY}-${BORNAGAIN_ARCHITECTURE}) -if(NOT CMAKE_BUILD_TYPE STREQUAL Release) - string(APPEND CPACK_PACKAGE_FILE_NAME -${CMAKE_BUILD_TYPE}) -endif() - - if(WIN32) include(BornAgain/PackWindows) elseif(APPLE) diff --git a/cmake/BornAgain/Qt.cmake b/cmake/BornAgain/Qt.cmake index 75ed4fc6a7cc91a204a6f3f9fb497c2d0ab1a600..8e4cbede15e7c0fd211fec97c3ff180f48b4723f 100644 --- a/cmake/BornAgain/Qt.cmake +++ b/cmake/BornAgain/Qt.cmake @@ -18,8 +18,3 @@ get_target_property(Qt5OpenGL_location Qt5::OpenGL LOCATION_Release) message(STATUS " ${Qt5OpenGL_LIBRARIES} ${Qt5OpenGL_location}") message(STATUS " Includes: ${Qt5Widgets_INCLUDE_DIRS}") - -# suppress qDebug() output for release build -if(CMAKE_BUILD_TYPE STREQUAL Release) - add_definitions(-DQT_NO_DEBUG_OUTPUT) -endif() diff --git a/cmake/BornAgain/SwigLib.cmake b/cmake/BornAgain/SwigLib.cmake index 1513b5e1c459509b14e8aa300148e99e48fc4329..f86ccd99a4db13adb6171c12ea2ef4ce83ea583f 100644 --- a/cmake/BornAgain/SwigLib.cmake +++ b/cmake/BornAgain/SwigLib.cmake @@ -76,8 +76,8 @@ function(SwigLib name lib TMP_DIR) add_dependencies(${lib} ${lib}_python) target_compile_definitions(${lib} PUBLIC -DBORNAGAIN_PYTHON) - target_include_directories(${lib} PUBLIC ${Python3_INCLUDE_DIRS} ${Python3_NumPy_INCLUDE_DIRS}) - target_link_libraries(${lib} ${Python3_LIBRARIES}) + target_include_directories(${lib} PRIVATE ${Python3_INCLUDE_DIRS} ${Python3_NumPy_INCLUDE_DIRS}) + target_link_libraries(${lib} PRIVATE ${Python3_LIBRARIES}) install(FILES ${CMAKE_BINARY_DIR}/lib/lib${lib}.py DESTINATION ${destination_lib} COMPONENT Libraries) # required by swig diff --git a/cmake/BornAgain/Windows.cmake b/cmake/BornAgain/Windows.cmake index 1c545fb68b49b52ca7299f5580a9fee4d6eaed1a..d96ff05f3798d78f83166b1575ff78c375160951 100644 --- a/cmake/BornAgain/Windows.cmake +++ b/cmake/BornAgain/Windows.cmake @@ -13,3 +13,6 @@ message(STATUS "Disabling static align for Eigen") string(APPEND CMAKE_CXX_FLAGS " /MD /MP /D_USE_MATH_DEFINES /wd4005 /wd4244 -I${CMAKE_SOURCE_DIR}/Wrap -FIw32pragma.h") # string(APPEND CMAKE_SHARED_LINKER_FLAGS " /NODEFAULTLIB:libcmtd.lib") + +# --- switch ON edit and continue; only in DEBUG configuration +add_compile_options($<$<CONFIG:Debug>:/ZI>)