set up CMakeLists.txt
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,6 @@
|
|||||||
/.vscode
|
/.vscode
|
||||||
/.devcontainer
|
/.devcontainer
|
||||||
/.github
|
/.github
|
||||||
|
/.cache
|
||||||
/build
|
/build
|
||||||
/.clang-format
|
/.clang-format
|
||||||
|
@ -4,11 +4,23 @@ include(CTest)
|
|||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -fsanitize=address -fsanitize=undefined -fsanitize=leak")
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -fsanitize=address -fsanitize=undefined -fsanitize=leak")
|
||||||
|
option(TEST_BPT_ONLY "Only build BPT tests" ON)
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
googletest
|
googletest
|
||||||
URL https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip
|
URL_HASH SHA256=1f357c27ca988c3f7c6b4bf68a9395005ac6761f034046e9dde0896e3aba00e4
|
||||||
|
URL ${CMAKE_SOURCE_DIR}/deps/googletest-v1.14.0-mirror.zip
|
||||||
)
|
)
|
||||||
FetchContent_MakeAvailable(googletest)
|
FetchContent_MakeAvailable(googletest)
|
||||||
include(GoogleTest)
|
include(GoogleTest)
|
||||||
enable_testing()
|
FetchContent_Declare(
|
||||||
|
argparse
|
||||||
|
URL_HASH SHA256=674e724c2702f0bfef1619161815257a407e1babce30d908327729fba6ce4124
|
||||||
|
URL ${CMAKE_SOURCE_DIR}/deps/argparse-v3.0-mirror.zip
|
||||||
|
)
|
||||||
|
FetchContent_MakeAvailable(argparse)
|
||||||
|
include_directories(${CMAKE_SOURCE_DIR}/include)
|
||||||
|
include_directories(${CMAKE_SOURCE_DIR}/bpt/include)
|
||||||
|
include_directories(${CMAKE_SOURCE_DIR}/stlite)
|
||||||
|
enable_testing()
|
||||||
|
add_subdirectory(test)
|
BIN
deps/argparse-v3.0-mirror.zip
vendored
Normal file
BIN
deps/argparse-v3.0-mirror.zip
vendored
Normal file
Binary file not shown.
BIN
deps/googletest-v1.14.0-mirror.zip
vendored
Normal file
BIN
deps/googletest-v1.14.0-mirror.zip
vendored
Normal file
Binary file not shown.
0
src/main.cpp
Normal file
0
src/main.cpp
Normal file
8
test/CMakeLists.txt
Normal file
8
test/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
if(TEST_BPT_ONLY)
|
||||||
|
add_executable(code oj_test_interface_for_bpt.cpp)
|
||||||
|
target_link_libraries(code argparse)
|
||||||
|
set_target_properties(code PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||||
|
else()
|
||||||
|
add_executable(oj_test_interface_for_bpt oj_test_interface_for_bpt.cpp)
|
||||||
|
target_link_libraries(oj_test_interface_for_bpt argparse)
|
||||||
|
endif()
|
5
test/oj_test_interface_for_bpt.cpp
Normal file
5
test/oj_test_interface_for_bpt.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#include <argparse/argparse.hpp>
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
Reference in New Issue
Block a user