Skip to content
Snippets Groups Projects
Commit 239a7119 authored by Ammar Nejati's avatar Ammar Nejati
Browse files

Directories.cmake: Simplify and clean up the destination-related part

parent 99ffc4a3
No related branches found
No related tags found
1 merge request!841Add Python Wheel to the Package
......@@ -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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment