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

Few fixes #9

Merged
merged 3 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Add subdirectory tests if BUILD_TESTING is ON
  • Loading branch information
ruthenium96 committed Apr 23, 2024
commit 4eb8d95e34614c3af4f21216e3a60f50ffa2d40e
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ SET_TARGET_PROPERTIES(${PROJECT_NAME}
VERSION ${wignerSymbols_VERSION_MAJOR}.${wignerSymbols_VERSION_MINOR}.${wignerSymbols_VERSION_RELEASE}
SOVERSION ${wignerSymbols_VERSION_MAJOR}.${wignerSymbols_VERSION_MINOR}.${wignerSymbols_VERSION_RELEASE})

add_subdirectory(tests)
if(BUILD_TESTING)
add_subdirectory(tests)
endif()

# Install directories
install(TARGETS ${PROJECT_NAME} DESTINATION lib)
Expand Down
10 changes: 4 additions & 6 deletions tests/CMakeLists.txt
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make the add_directory(tests) in the main CMakeLists.txt conditional on BUILD_TESTING being true instead? That way, we wouldn't skip tests when we actually want to test them, and armadillo becomes a dev dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the requested changes in the last commit. Thank you for this suggestion!

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ target_link_libraries(gh-issue-2 ${PROJECT_NAME})
add_test(NAME gh-issue-2 COMMAND gh-issue-2)

find_package(Armadillo)
if (ARMADILLO_FOUND)
include_directories(${ARMADILLO_INCLUDE_DIRS})
add_executable(testWigner testWigner.cpp)
target_link_libraries(testWigner ${PROJECT_NAME} ${ARMADILLO_LIBRARIES})
add_test(NAME testWigner COMMAND testWigner 10)
endif()
include_directories(${ARMADILLO_INCLUDE_DIRS})
add_executable(testWigner testWigner.cpp)
target_link_libraries(testWigner ${PROJECT_NAME} ${ARMADILLO_LIBRARIES})
add_test(NAME testWigner COMMAND testWigner 10)