Skip to content

Commit

Permalink
cmake: handle symlinking if in-source
Browse files Browse the repository at this point in the history
  • Loading branch information
program-- committed Dec 26, 2023
1 parent 6e49ee8 commit 0c908de
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ add_dependencies(ngen testbmicppmodel)

# =============================================================================

# Create a symlink between the root data directory in the source tree and the build tree
file(CREATE_LINK "${NGEN_ROOT_DIR}/data" "${PROJECT_BINARY_DIR}/data" SYMBOLIC)

# Create a symlink between the test data directory in the source tree and the build tree
file(CREATE_LINK "${CMAKE_CURRENT_LIST_DIR}/data" "${PROJECT_BINARY_DIR}/test/data" SYMBOLIC)
# If ${NGEN_ROOT_DIR} and ${PROJECT_BINARY_DIR} are the same, then we have an in-source build
# and this is not necessary.
if(NOT NGEN_ROOT_DIR STREQUAL PROJECT_BINARY_DIR)
# Create a symlink between the root data directory in the source tree and the build tree
file(CREATE_LINK "${NGEN_ROOT_DIR}/data" "${PROJECT_BINARY_DIR}/data" SYMBOLIC)

# Create a symlink between the test data directory in the source tree and the build tree
file(CREATE_LINK "${CMAKE_CURRENT_LIST_DIR}/data" "${PROJECT_BINARY_DIR}/test/data" SYMBOLIC)
endif()

# =============================================================================

Expand Down

0 comments on commit 0c908de

Please sign in to comment.