diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d7c179281..e562bd872 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,6 +121,11 @@ set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} ${LIBDIVECOMPUTER_LIB # handle out of tree build correctly string(COMPARE EQUAL "${${PROJECT_NAME}_SOURCE_DIR}" "${${PROJECT_NAME}_BINARY_DIR}" insource) +if (insource) + message(STATUS "building in Subsurface source tree - we recommend out of tree builds") +else() + message(STATUE "out of source build from source in ${${PROJECT_NAME}_SOURCE_DIR}") +endif() get_filename_component(PARENTDIR ${${PROJECT_NAME}_SOURCE_DIR} PATH) string(COMPARE EQUAL "${${PROJECT_NAME}_SOURCE_DIR}" "${PARENTDIR}" insourcesubdir) if(NOT (insource OR insourcedir)) @@ -467,15 +472,32 @@ endif() # install a few things so that one can run Subsurface from the build # directory -add_custom_target(createLinks ALL COMMAND rm -f ${CMAKE_BINARY_DIR}/theme && ln -s ${CMAKE_SOURCE_DIR}/theme ${CMAKE_BINARY_DIR}/theme) -if(NOT NO_PRINTING) - add_custom_target(printing_templates ALL COMMAND rm -f ${CMAKE_BINARY_DIR}/printing_templates && ln -s ${CMAKE_SOURCE_DIR}/printing_templates ${CMAKE_BINARY_DIR}/printing_templates) +if(NOT insource) + add_custom_target(themeLink ALL + COMMAND + rm -f ${CMAKE_BINARY_DIR}/theme && + ln -s ${CMAKE_SOURCE_DIR}/theme ${CMAKE_BINARY_DIR}/theme + ) + if(NOT NO_PRINTING) + add_custom_target(printing_templatesLink ALL + COMMAND + rm -f ${CMAKE_BINARY_DIR}/printing_templates && + ln -s ${CMAKE_SOURCE_DIR}/printing_templates ${CMAKE_BINARY_DIR}/printing_templates + ) + endif() + if(NOT NO_DOCS) + add_custom_target( + documentationLink ALL + COMMAND + mkdir -p ${CMAKE_BINARY_DIR}/Documentation/ && + rm -f ${CMAKE_BINARY_DIR}/Documentation/images && + ln -s ${CMAKE_SOURCE_DIR}/Documentation/images ${CMAKE_BINARY_DIR}/Documentation/images + ) + endif() endif() if(NOT NO_DOCS) add_custom_target( documentation ALL - mkdir -p ${CMAKE_BINARY_DIR}/Documentation/ \\; - cp -a ${CMAKE_SOURCE_DIR}/Documentation/images ${CMAKE_BINARY_DIR}/Documentation/ \\; make -C ${CMAKE_SOURCE_DIR}/Documentation OUT=${CMAKE_BINARY_DIR}/Documentation/ doc ) endif() |