diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f8572e..f42ec18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 ) @@ -59,9 +63,19 @@ if( UNIX ) target_link_libraries( enkiTS ${CMAKE_THREAD_LIBS_INIT} ) endif() +target_include_directories(enkiTS PUBLIC "$") 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 + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(FILES ${ENKITS_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + install( + EXPORT enkiTS-config + NAMESPACE enkiTS:: + DESTINATION ${CMAKE_INSTALL_DATADIR}/enkiTS) endif() if( UNIX )