Skip to content

Commit

Permalink
🔨 Add installation support
Browse files Browse the repository at this point in the history
Co-authored-by: Ahmed Yarub Hani Al Nuaimi <ahmed.alnuaimi@zwift.com>
  • Loading branch information
Ahmed Yarub Hani Al Nuaimi and ahmedalnuaimi authored Jul 15, 2021
1 parent 5dbf06b commit e006778
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ else()
target_compile_definitions(${QOLM_TARGET} PUBLIC "-DQOLM_STATIC")
endif()

target_include_directories(${QOLM_TARGET} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_include_directories(${QOLM_TARGET} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_compile_features(${QOLM_TARGET} PUBLIC cxx_std_17)
target_link_libraries(${QOLM_TARGET} PUBLIC Qt::Core Qt::Qml)

Expand All @@ -134,3 +137,23 @@ endif()
if(QOLM_MAIN_PROJECT)
include(cmake/PrintConfiguration.cmake)
endif()

include(GNUInstallDirs)
install(TARGETS ${QOLM_TARGET}
EXPORT ${QOLM_TARGET}Targets
)

export(EXPORT ${QOLM_TARGET}Targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/${QATERIAL_TARGET}/${QOLM_TARGET}Targets.cmake"
NAMESPACE ${QOLM_TARGET}::
)

set(ConfigPackageLocation lib/cmake/${QOLM_TARGET})
install(EXPORT ${QOLM_TARGET}Targets
FILE
${QOLM_TARGET}Targets.cmake
NAMESPACE
${QOLM_TARGET}::
DESTINATION
${ConfigPackageLocation}
)

0 comments on commit e006778

Please sign in to comment.