Skip to content
Closed
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
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,22 @@ add_library(beman::exemplar ALIAS beman.exemplar)

target_sources(
beman.exemplar
PUBLIC FILE_SET HEADERS BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include"
PUBLIC
FILE_SET HEADERS
BASE_DIRS
include #NO! "${CMAKE_CURRENT_SOURCE_DIR}/include"
FILES include/beman/exemplar/identity.hpp
)

set_target_properties(beman.exemplar PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON)

add_subdirectory(include/beman/exemplar)
#NO! add_subdirectory(include/beman/exemplar)

beman_install_library(beman.exemplar)

if(BEMAN_EXEMPLAR_BUILD_TESTS)
enable_testing()
add_subdirectory(tests/beman/exemplar)
add_subdirectory(tests)
endif()

if(BEMAN_EXEMPLAR_BUILD_EXAMPLES)
Expand Down
10 changes: 7 additions & 3 deletions cookiecutter/{{cookiecutter.project_name}}/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@ add_library(beman::{{cookiecutter.project_name}} ALIAS beman.{{cookiecutter.proj

target_sources(
beman.{{cookiecutter.project_name}}
PUBLIC FILE_SET HEADERS BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include"
PUBLIC
FILE_SET HEADERS
BASE_DIRS
include #NO! "${CMAKE_CURRENT_SOURCE_DIR}/include"
FILES include/beman/{{cookiecutter.project_name}}/identity.hpp
)

set_target_properties(beman.{{cookiecutter.project_name}} PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON)

add_subdirectory(include/beman/{{cookiecutter.project_name}})
#NO! add_subdirectory(include/beman/{{cookiecutter.project_name}})
{% if cookiecutter.library_type == "static" %}
add_subdirectory(src/beman/{{cookiecutter.project_name}})
{% endif %}
Expand All @@ -50,7 +54,7 @@ beman_install_library(beman.{{cookiecutter.project_name}})

if(BEMAN_{{cookiecutter.project_name.upper()}}_BUILD_TESTS)
enable_testing()
add_subdirectory(tests/beman/{{cookiecutter.project_name}})
add_subdirectory(tests)
endif()

if(BEMAN_{{cookiecutter.project_name.upper()}}_BUILD_EXAMPLES)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

set(BUILD_GMOCK OFF)
find_package(GTest REQUIRED)

add_executable(beman.{{cookiecutter.project_name}}.tests.identity)
target_sources(beman.{{cookiecutter.project_name}}.tests.identity PRIVATE identity.test.cpp)
target_link_libraries(
beman.{{cookiecutter.project_name}}.tests.identity
PRIVATE beman::{{cookiecutter.project_name}} GTest::gtest GTest::gtest_main
PRIVATE beman::{{cookiecutter.project_name}} GTest::gtest_main
)

include(GoogleTest)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

set(BUILD_GMOCK OFF)
find_package(GTest REQUIRED)

add_executable(beman.exemplar.tests.identity)
target_sources(beman.exemplar.tests.identity PRIVATE identity.test.cpp)
target_link_libraries(
beman.exemplar.tests.identity
PRIVATE beman::exemplar GTest::gtest GTest::gtest_main
PRIVATE beman::exemplar GTest::gtest_main
)

include(GoogleTest)
Expand Down
File renamed without changes.