29 lines
657 B
CMake
29 lines
657 B
CMake
cmake_minimum_required(VERSION 3.13) # CMake version check
|
|
project(VectorAlgebra) # Create project "simple_example"
|
|
|
|
set(CMAKE_CXX_STANDARD 11) # Enable c++14 standard
|
|
|
|
include(FetchContent)
|
|
FetchContent_Declare(
|
|
googletest
|
|
URL https://github.com/google/googletest/archive/refs/heads/main.zip
|
|
)
|
|
FetchContent_MakeAvailable(googletest)
|
|
include_directories(include)
|
|
|
|
add_library(VectorAlgebra STATIC "src/Vector3.cpp" "src/Quaternion.cpp")
|
|
|
|
enable_testing()
|
|
|
|
add_executable(
|
|
hello_test
|
|
"test/hello_test.cc"
|
|
)
|
|
target_link_libraries(
|
|
hello_test
|
|
gtest_main
|
|
)
|
|
|
|
include(GoogleTest)
|
|
gtest_discover_tests(hello_test)
|