Skip to content

Commit

Permalink
"updated cmake"
Browse files Browse the repository at this point in the history
  • Loading branch information
jpihl committed Feb 4, 2021
1 parent 6b36249 commit c2542cc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
21 changes: 16 additions & 5 deletions CMakeLists.txt
@@ -1,11 +1,22 @@
cmake_minimum_required (VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(platform)

file(GLOB platform_headers ./src/platform/*.hpp)

# Define library
add_library(platform INTERFACE)
target_compile_features(platform INTERFACE cxx_std_14)
target_include_directories(platform INTERFACE src/)
add_library(steinwurf::platform ALIAS platform)

target_include_directories(platform INTERFACE src/)
# Install headers
install(
DIRECTORY ./src/platform
DESTINATION ${CMAKE_INSTALL_PREFIX}/include
FILES_MATCHING
PATTERN *.hpp)

install(FILES ${platform_headers} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/platform)
# Is top level project?
if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME})
# Build executables
add_executable(print_platform examples/print_platform/main.cpp)
target_link_libraries(print_platform platform)
endif()
2 changes: 1 addition & 1 deletion NEWS.rst
Expand Up @@ -6,7 +6,7 @@ every change, see the Git log.

Latest
------
* tbd
* Major: Change cmake build to be object library based.

3.5.0
-----
Expand Down

0 comments on commit c2542cc

Please sign in to comment.