Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for an installable cmake target #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,27 @@ if (BUILD_EXAMPLE)
endif (BUILD_EXAMPLE)


install(FILES include/aixlog.hpp DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")

# create interface library
add_library(aixlog INTERFACE)
target_include_directories(aixlog INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/>
$<INSTALL_INTERFACE:include>)


SET(INSTALL_AIXLOG ON CACHE BOOL "Enable install target for aixlog")
if (INSTALL_AIXLOG)
install(FILES include/aixlog.hpp DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")

# Make an export target
install(TARGETS aixlog EXPORT aixlogConfig)

# Install the export target as a file
install(EXPORT aixlogConfig DESTINATION "cmake")

endif()



FIND_PROGRAM(CLANG_FORMAT "clang-format")
IF(CLANG_FORMAT)
Expand Down