Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.6)
cmake_minimum_required(VERSION 3.15)
project(libcanon VERSION 0.1.0 LANGUAGES CXX)

# OPTIONS
Expand All @@ -8,6 +8,8 @@ option(BUILD_DOCS "Build the API documentation" OFF)

# Set the building options.
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# The main components.
add_subdirectory(include)
Expand Down Expand Up @@ -35,7 +37,7 @@ write_basic_package_version_file(${CONFIGVERSION_FILE}
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion)
install(EXPORT libcanon_exports FILE libcanon-targets.cmake
NAMESPACE libcanon DESTINATION ${CONFIG_DESTINATION})
NAMESPACE libcanon:: DESTINATION ${CONFIG_DESTINATION})
install(FILES ${CONFIG_FILE} ${CONFIGVERSION_FILE}
DESTINATION ${CONFIG_DESTINATION})

Expand Down
6 changes: 3 additions & 3 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# The phony licanon library for export.
# The phony libcanon library for export.
add_library(headers INTERFACE)
target_include_directories(headers INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libcanon>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libcanon>)
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
install(TARGETS headers EXPORT libcanon_exports)

# Installation of the real thing.
Expand Down
5 changes: 1 addition & 4 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ add_subdirectory(googletest EXCLUDE_FROM_ALL)
include(CTest)
function(add_simple_test name)
add_executable("${name}" "${name}.cpp")
target_include_directories("${name}" PRIVATE
"${libcanon_SOURCE_DIR}/include"
"${gtest_SOURCE_DIR}/include")
target_link_libraries("${name}" gtest gtest_main)
target_link_libraries("${name}" PRIVATE headers gtest gtest_main)
add_test(NAME "${name}" COMMAND "${name}")
endfunction()

Expand Down