Skip to content

Commit

Permalink
cmake: fix namespace and include dir (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
abouvier authored Jan 2, 2024
1 parent 09c21bd commit aeacf86
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ configure_package_config_file(${PROJECT_NAME}Config.cmake.in
)

install(FILES SimpleIni.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

install(TARGETS ${PROJECT_NAME}
Expand All @@ -62,12 +62,15 @@ install(FILES
)
install(EXPORT ${PROJECT_NAME}Targets
DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake/${PROJECT_NAME}
NAMESPACE EXPORT_NAMESPACE
NAMESPACE ${EXPORT_NAMESPACE}
)

target_include_directories(${PROJECT_NAME} INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_include_directories(${PROJECT_NAME} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

if(IS_TOPLEVEL_PROJECT)
enable_testing()
include(CTest)
add_subdirectory(tests)
endif()

0 comments on commit aeacf86

Please sign in to comment.