Skip to content

Commit c3dd892

Browse files
committed
Fixed Cmake
1 parent 8b97022 commit c3dd892

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

CMakeLists.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ include(FetchContent)
2323
FetchContent_Declare(
2424
googletest
2525
URL https://github.com/google/googletest/archive/refs/heads/main.zip
26+
DOWNLOAD_EXTRACT_TIMESTAMP true
2627
)
2728
# For Windows: Prevent overriding the parent project's compiler/linker settings
2829
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
@@ -41,28 +42,28 @@ endif()
4142

4243
option(ENABLE_EXAMPLE "Enable Example" OFF)
4344

44-
if(ENABLE_TEST)
45+
if(ENABLE_EXAMPLE)
4546
add_executable(basic examples/basic.cpp)
4647
target_include_directories(basic PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
47-
target_link_libraries(basic PUBLIC CXXStateTree)
48+
target_link_libraries(basic PRIVATE CXXStateTree)
4849

4950
add_executable(nested examples/nested.cpp)
5051
target_include_directories(basic PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
51-
target_link_libraries(nested PUBLIC CXXStateTree)
52+
target_link_libraries(nested PRIVATE CXXStateTree)
5253

5354
add_executable(export_dot_example examples/export_dot.cpp)
5455
target_include_directories(export_dot_example PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
55-
target_link_libraries(export_dot_example PUBLIC CXXStateTree)
56+
target_link_libraries(export_dot_example PRIVATE CXXStateTree)
5657
add_executable(export_dot_nested_example examples/export_dot_nested.cpp)
5758
target_include_directories(export_dot_nested_example PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
58-
target_link_libraries(export_dot_nested_example PUBLIC CXXStateTree)
59+
target_link_libraries(export_dot_nested_example PRIVATE CXXStateTree)
5960
add_executable(export_dot_context_example examples/export_dot_context.cpp)
6061
target_include_directories(export_dot_context_example PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
61-
target_link_libraries(export_dot_context_example PUBLIC CXXStateTree)
62+
target_link_libraries(export_dot_context_example PRIVATE CXXStateTree)
6263

6364
add_executable(context_example examples/context_example.cpp)
6465
target_include_directories(context_example PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
65-
target_link_libraries(context_example PUBLIC CXXStateTree)
66+
target_link_libraries(context_example PRIVATE CXXStateTree)
6667

6768
endif()
6869

@@ -112,6 +113,7 @@ if(ENABLE_SINGLE_HEADER)
112113
FetchContent_Declare(
113114
googletest
114115
URL https://github.com/google/googletest/archive/refs/heads/main.zip
116+
DOWNLOAD_EXTRACT_TIMESTAMP true
115117
)
116118
# For Windows: Prevent overriding the parent project's compiler/linker settings
117119
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

0 commit comments

Comments
 (0)