diff --git a/cmake/BornAgain/Directories.cmake b/cmake/BornAgain/Directories.cmake index c7eeb27a717b8030310df328b12f50f772447e15..7cdeab1c8ca904f1084c6133778f79d1f4c210c1 100644 --- a/cmake/BornAgain/Directories.cmake +++ b/cmake/BornAgain/Directories.cmake @@ -72,40 +72,30 @@ endif() # ----------------------------------------------------------------------------- # destinations # ----------------------------------------------------------------------------- +set(destination_suffix ${CMAKE_PROJECT_NAME}_${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}) -if(WIN32) - set(destination_bin bin) - set(destination_lib bin) - set(destination_include include) - set(destination_examples Examples) - set(destination_images Images) - set(destination_python python) -else() - set(destination_suffix BornAgain-${BornAgain_VERSION_MAJOR}.${BornAgain_VERSION_MINOR}) - if(APPLE AND BA_APPLE_BUNDLE) - set(destination_bundle BornAgain.app) - set(destination_prefix ${destination_bundle}/Contents/) - else() - if(APPLE) - set(QTDIR $ENV{QTDIR}) - message(STATUS "QTDIR is ${QTDIR}") - set(CMAKE_INSTALL_RPATH ${QTDIR}/lib) - endif() - set(destination_prefix "") - endif() - set(destination_bin ${destination_prefix}bin) - set(destination_lib ${destination_prefix}lib) - set(destination_include ${destination_prefix}include/${destination_suffix}) - set(destination_share ${destination_prefix}share/${destination_suffix}/) - set(destination_examples ${destination_share}Examples) - set(destination_images ${destination_share}Images) -endif() +set(dstIds "") +if(APPLE AND BA_APPLE_BUNDLE) + set(destination_bundle BornAgain.app) + set(destination_root ${destination_bundle}/Contents/) + list(APPEND dstIds "bundle") +endif() -message(STATUS "Destination directories: - bin->${destination_bin}, - lib->${destination_lib}, - include->${destination_include}, - share->${destination_share}, - examples->${destination_examples}, - images->${destination_images}") +set(destination_bin ${destination_root}bin/) +set(destination_lib ${destination_root}lib/) +if(WIN32) + # on Window, the libraries must be in the same folder as the executable + set(destination_lib ${destination_bin}) +endif(WIN32) +set(destination_include ${destination_root}include/${destination_suffix}/) +set(destination_share ${destination_root}share/${destination_suffix}/) +set(destination_examples ${destination_share}Examples/) +set(destination_images ${destination_share}Images/) + +list(APPEND dstIds bin lib include share examples images) + +message(STATUS "Destination directories:") +foreach(dstId IN LISTS dstIds) + message(" ${dstId} -> ${destination_${dstId}}") +endforeach()