Skip to content

Commit

Permalink
Flag to suppress OndselSolverMain
Browse files Browse the repository at this point in the history
  • Loading branch information
aiksiongkoh committed Aug 30, 2024
1 parent 973c94a commit bac92a0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

option(ONDSELSOLVER_BUILD_TESTS "Set to ON to build the Google Test-based C++ test suite." OFF)
option(ONDSELSOLVER_BUILD_EXE "Set to ON to build the standalone OndselSolver executable." OFF)

include(GNUInstallDirs)

Expand All @@ -19,13 +20,14 @@ ENDIF ()

add_compile_definitions(TEST_DATA_PATH="${CMAKE_CURRENT_SOURCE_DIR}/testapp")
add_subdirectory(OndselSolver)
add_subdirectory(OndselSolverMain)
if(ONDSELSOLVER_BUILD_EXE)
add_subdirectory(OndselSolverMain)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OndselSolverMain PROPERTY VS_STARTUP_PROJECT OndselSolverMain)
endif()

if(ONDSELSOLVER_BUILD_TESTS)
include(CTest)
enable_testing()
add_subdirectory(tests)
target_compile_definitions(test_run PUBLIC TEST_DATA_PATH="${CMAKE_CURRENT_SOURCE_DIR}/testapp")
endif()

set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OndselSolverMain PROPERTY VS_STARTUP_PROJECT OndselSolverMain)

0 comments on commit bac92a0

Please sign in to comment.