add ENABLE_TEST OPTION
This commit is contained in:
parent
8863c2ff2a
commit
a8abebd466
2
.vscode/tasks.json
vendored
2
.vscode/tasks.json
vendored
|
@ -9,7 +9,7 @@
|
|||
"command": "bash",
|
||||
"args": [
|
||||
"-c",
|
||||
"cd ${workspaceFolder}/build && cmake .. -DCMAKE_BUILD_TYPE=Debug && make -j4",
|
||||
"cd ${workspaceFolder} && mkdir -p build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Debug && make -j4",
|
||||
],
|
||||
"options": {
|
||||
"cwd": "/bin"
|
||||
|
|
|
@ -5,6 +5,8 @@ SET(CMAKE_BUILD_TYPE "Debug")
|
|||
SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb")
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
|
||||
|
||||
option(ENABLE_TEST "gtest build" OFF)
|
||||
|
||||
# include(CTest)
|
||||
# enable_testing()
|
||||
|
||||
|
@ -19,7 +21,12 @@ link_directories(
|
|||
/usr/local/lib/
|
||||
)
|
||||
|
||||
add_subdirectory(gtest)
|
||||
|
||||
|
||||
if(ENABLE_TEST)
|
||||
add_subdirectory(gtest)
|
||||
endif(ENABLE_TEST)
|
||||
|
||||
add_executable(orderly src/main.cpp)
|
||||
|
||||
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
|
||||
|
|
Loading…
Reference in New Issue
Block a user