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 cmake install #84

Merged
merged 2 commits into from
Sep 16, 2017
Merged
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
26 changes: 23 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)

PROJECT(units)
PROJECT(units LANGUAGES CXX)

OPTION(BUILD_TESTS "Build unit tests" ON)
OPTION(BUILD_DOCS "Build the documentation" OFF)
Expand All @@ -23,7 +23,15 @@ endif()
# add_subdirectory(units) # or whatever you named the directory
# target_link_libraries(${PROJECT_NAME} units)
add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(${PROJECT_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include)

target_compile_features(${PROJECT_NAME}
INTERFACE cxx_variadic_templates
)

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

# Remove IOStream from the library (useful for embdedded development)
if(DISABLE_IOSTREAM)
Expand All @@ -49,4 +57,16 @@ if(BUILD_DOCS)
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif(DOXYGEN_FOUND)
endif(BUILD_DOCS)
endif(BUILD_DOCS)

install(TARGETS units
EXPORT unitsConfig
)

install(DIRECTORY include/
DESTINATION include
)

install(EXPORT unitsConfig
DESTINATION cmake
)