File tree Expand file tree Collapse file tree 1 file changed +27
-19
lines changed
Expand file tree Collapse file tree 1 file changed +27
-19
lines changed Original file line number Diff line number Diff line change @@ -4,24 +4,32 @@ project(binsparse)
44set (CMAKE_CXX_STANDARD 20)
55set (CMAKE_CXX_STANDARD_REQUIRED ON )
66
7- set (CMAKE_CXX_FLAGS "-O3" )
8-
9- include (FetchContent)
10- FetchContent_Declare(
11- googletest
12- URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
13- )
14- # For Windows: Prevent overriding the parent project's compiler/linker settings
15- set (gtest_force_shared_crt ON CACHE BOOL "" FORCE)
16- FetchContent_MakeAvailable(googletest)
17-
18- FetchContent_Declare(
19- fmt
20- GIT_REPOSITORY https://github.com/fmtlib/fmt.git
21- GIT_TAG 10.1.1)
22- FetchContent_MakeAvailable(fmt)
23-
247find_package (HDF5 REQUIRED COMPONENTS CXX)
258add_subdirectory (include )
26- add_subdirectory (examples)
27- add_subdirectory (test )
9+
10+ if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME )
11+ # Dependencies needed only for examples/test
12+
13+ # Google test
14+ include (FetchContent)
15+ FetchContent_Declare(
16+ googletest
17+ URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
18+ )
19+ # For Windows: Prevent overriding the parent project's compiler/linker settings
20+ set (gtest_force_shared_crt ON CACHE BOOL "" FORCE)
21+ FetchContent_MakeAvailable(googletest)
22+
23+ # fmt
24+ FetchContent_Declare(
25+ fmt
26+ GIT_REPOSITORY https://github.com/fmtlib/fmt.git
27+ GIT_TAG 10.1.1)
28+ FetchContent_MakeAvailable(fmt)
29+
30+ set (CMAKE_CXX_FLAGS "-O3 -march=native" )
31+
32+ add_subdirectory (examples)
33+ add_subdirectory (test )
34+
35+ endif ()
You can’t perform that action at this time.
0 commit comments