Skip to content

Commit

Permalink
[edit] CMake test target only for the main file
Browse files Browse the repository at this point in the history
  • Loading branch information
arkaht committed Apr 25, 2024
1 parent a628534 commit d91b871
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,10 @@ target_include_directories(curve_x PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/")
target_sources(curve_x PRIVATE "${CURVE_X_SOURCES}")

# Declare test executable
add_executable(curve_x_test "tests/main.cpp")
target_link_libraries(curve_x_test PRIVATE curve_x)
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
add_executable(curve_x_test "tests/main.cpp")
target_link_libraries(curve_x_test PRIVATE curve_x)
message("Included Curve-X test")
else()
message("Skipped Curve-X test")
endif ()

0 comments on commit d91b871

Please sign in to comment.