Skip to content

Commit

Permalink
improve install support for enkiTS (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
pr0g committed Jul 26, 2023
1 parent cafed84 commit 0d0b53b
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.0)

project( enkiTS )

include(GNUInstallDirs)

option( ENKITS_BUILD_C_INTERFACE "Build C interface" ON )
option( ENKITS_BUILD_EXAMPLES "Build example applications" ON )
option( ENKITS_BUILD_SHARED "Build shared library" OFF )
Expand Down Expand Up @@ -43,7 +45,9 @@ else()
add_library( enkiTS STATIC ${ENKITS_SRC} )
endif()

target_include_directories( enkiTS PUBLIC "${PROJECT_SOURCE_DIR}/src")
target_include_directories( enkiTS PUBLIC
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> )

if( ENKITS_TASK_PRIORITIES_NUM GREATER "0" )
target_compile_definitions( enkiTS PUBLIC "ENKITS_TASK_PRIORITIES_NUM=${ENKITS_TASK_PRIORITIES_NUM}" )
Expand All @@ -59,8 +63,15 @@ if( UNIX )
endif()

if( ENKITS_INSTALL )
install(TARGETS enkiTS DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/enkiTS")
install(FILES ${ENKITS_HEADERS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/enkiTS")
install(
TARGETS enkiTS
EXPORT enkiTS-config
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES ${ENKITS_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(
EXPORT enkiTS-config
NAMESPACE enkiTS::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/enkiTS)
endif()

if( UNIX )
Expand Down

0 comments on commit 0d0b53b

Please sign in to comment.