forked from muellan/clipp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes in this commit involve removing some existing parts of the main CMake file and enabling the building of examples from the main CMake. Signed-off-by: Tomasz Leman <tomasz.leman@outlook.com>
- Loading branch information
Showing
3 changed files
with
36 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,22 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
project(clipp | ||
VERSION 1.2.3 | ||
LANGUAGES CXX) | ||
|
||
include(GNUInstallDirs) | ||
set(CMAKE_VERBOSE_MAKEFILE ON) | ||
|
||
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}") | ||
add_library(${PROJECT_NAME} INTERFACE) | ||
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) | ||
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_11) | ||
target_include_directories(${PROJECT_NAME} INTERFACE | ||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> | ||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
) | ||
|
||
set(CONFIG_VERSION_FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake) | ||
include(CMakePackageConfigHelpers) | ||
write_basic_package_version_file( | ||
${CONFIG_VERSION_FILE} COMPATIBILITY AnyNewerVersion | ||
) | ||
|
||
install(DIRECTORY include/ | ||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} | ||
FILES_MATCHING PATTERN "*.h" | ||
) | ||
install(TARGETS ${PROJECT_NAME} | ||
EXPORT ${PROJECT_NAME}-config | ||
) | ||
install(EXPORT ${PROJECT_NAME}-config | ||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME} | ||
NAMESPACE ${PROJECT_NAME}:: | ||
) | ||
install(FILES ${CONFIG_VERSION_FILE} | ||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME} | ||
) | ||
|
||
option(BUILD_TESTING "Do not build tests by default" OFF) | ||
include(CTest) | ||
if(BUILD_TESTING AND ${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) | ||
add_subdirectory(test) | ||
VERSION 1.2.3 | ||
LANGUAGES CXX) | ||
|
||
if (NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE Debug) | ||
endif() | ||
|
||
message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") | ||
|
||
message(STATUS "CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}") | ||
|
||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
||
include_directories(include) | ||
|
||
add_subdirectory(examples) | ||
|
||
enable_testing() | ||
add_subdirectory(test) | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters