Skip to content

Commit

Permalink
Let citygmlConfig.cmake also define include dirs.
Browse files Browse the repository at this point in the history
With this a library user can just use
target_link_libraries(citygml::citygml) and the
include directories are set up automatically.
  • Loading branch information
gostefan committed Sep 15, 2024
1 parent 4121de4 commit e53bfce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,14 @@ SET(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib)
MAKE_DIRECTORY(${OUTPUT_LIBDIR})
SET(LIBRARY_OUTPUT_PATH ${OUTPUT_LIBDIR})

if(NOT DEFINED INCLUDE_INSTALL_DIR)
set(INCLUDE_INSTALL_DIR "include")
endif(NOT DEFINED INCLUDE_INSTALL_DIR)
set(INCLUDE_INSTALL_CITYGML_DIR "${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR}/citygml")

if(NOT DEFINED DATA_INSTALL_DIR)
set(DATA_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share")
endif(NOT DEFINED DATA_INSTALL_DIR)
if(NOT DEFINED INCLUDE_INSTALL_DIR)
set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/citygml")
endif(NOT DEFINED INCLUDE_INSTALL_DIR)
if(NOT DEFINED MAN_INSTALL_DIR)
set(MAN_INSTALL_DIR "${DATA_INSTALL_DIR}/man")
endif(NOT DEFINED MAN_INSTALL_DIR)
Expand Down
8 changes: 5 additions & 3 deletions sources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,9 @@ set_target_properties( ${target} PROPERTIES
)

if(NOT DEFINED INCLUDE_INSTALL_DIR)
set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/citygml")
set(INCLUDE_INSTALL_DIR "include")
endif(NOT DEFINED INCLUDE_INSTALL_DIR)
set(INCLUDE_INSTALL_CITYGML_DIR "${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR}/citygml")

if(WIN32)
set(CONFIG_INSTALL_DIR "cmake")
Expand All @@ -265,6 +266,7 @@ INSTALL(
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES DESTINATION ${INCLUDE_INSTALL_DIR}
COMPONENT "runtime"
)
INSTALL(
Expand Down Expand Up @@ -294,15 +296,15 @@ INSTALL(
INSTALL(
FILES
${PUBLIC_HEADER}
DESTINATION ${INCLUDE_INSTALL_DIR}
DESTINATION ${INCLUDE_INSTALL_CITYGML_DIR}
COMPONENT "development"
)

INSTALL(
FILES
${EXPORT_HEADER_FILE_NAME}
DESTINATION
${INCLUDE_INSTALL_DIR}
${INCLUDE_INSTALL_CITYGML_DIR}
COMPONENT "development"
)

Expand Down

0 comments on commit e53bfce

Please sign in to comment.