Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some minor cmake changes to better support subproject usage #113

Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (SCN_IS_TOP_PROJECT AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "")
endif()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
eliaskosunen marked this conversation as resolved.
Show resolved Hide resolved

include(cmake/util.cmake)
include(cmake/options.cmake)
Expand Down
2 changes: 1 addition & 1 deletion cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ endif ()
option(SCN_TESTS "Enable tests" ${SCN_ENABLE_EXTRAS})
option(SCN_DOCS "Enable docs target" ${SCN_ENABLE_EXTRAS})
option(SCN_EXAMPLES "Enable examples target" ${SCN_ENABLE_EXTRAS})
option(SCN_INSTALL "Enable install target" ${SCN_ENABLE_EXTRAS})
option(SCN_INSTALL "Enable install target" ON)
eliaskosunen marked this conversation as resolved.
Show resolved Hide resolved

option(SCN_BENCHMARKS "Enable runtime benchmarks" ${SCN_ENABLE_EXTRAS})
option(SCN_BENCHMARKS_BUILDTIME "Enable buildtime benchmarks" ${SCN_ENABLE_EXTRAS})
Expand Down
8 changes: 4 additions & 4 deletions tests/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,21 @@ add_custom_target(scn_stdin_test_prepare ALL
COMMAND ${CMAKE_COMMAND} -E copy
"${CMAKE_CURRENT_LIST_DIR}/stdin_test_runner.py"
"${CMAKE_CURRENT_LIST_DIR}/stdin_test_input.txt"
"${CMAKE_BINARY_DIR}/tests/unittests"
"${CMAKE_CURRENT_BINARY_DIR}"
COMMENT "Copying stdin test runner"
)
add_custom_target(scn_examples_test_prepare ALL
COMMAND ${CMAKE_COMMAND} -E copy
"${CMAKE_CURRENT_LIST_DIR}/examples_test_runner.py"
"${CMAKE_BINARY_DIR}"
"${PROJECT_BINARY_DIR}"
COMMENT "Copying examples test runner"
)

find_package(Python3 COMPONENTS Interpreter)
if (Python3_FOUND)
add_test(NAME scn_stdin_test COMMAND ${Python3_EXECUTABLE} "${CMAKE_BINARY_DIR}/tests/unittests/stdin_test_runner.py")
add_test(NAME scn_stdin_test COMMAND ${Python3_EXECUTABLE} "${CMAKE_CURRENT_BINARY_DIR}/stdin_test_runner.py")
if (SCN_EXAMPLES)
add_test(NAME scn_examples_test COMMAND ${Python3_EXECUTABLE} "${CMAKE_BINARY_DIR}/examples_test_runner.py")
add_test(NAME scn_examples_test COMMAND ${Python3_EXECUTABLE} "${PROJECT_BINARY_DIR}/examples_test_runner.py")
else()
message(STATUS "scn_examples_test disabled, because SCN_EXAMPLES is OFF")
endif()
Expand Down
Loading