-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from KIT-MRT/modernize_cmake
Modernize cmake
- Loading branch information
Showing
11 changed files
with
218 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
../.env | ||
version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
################### | ||
## Find packages ## | ||
################### | ||
|
||
find_package(GTest) | ||
|
||
|
||
########### | ||
## Build ## | ||
########### | ||
|
||
if(GTEST_FOUND) | ||
file(GLOB_RECURSE _tests CONFIGURE_DEPENDS "*.cpp" "*.cc") | ||
|
||
foreach(_test ${_tests}) | ||
get_filename_component(_test_name ${_test} NAME_WE) | ||
# make sure we add only one -test to the target | ||
string(REGEX REPLACE "-test" "" TEST_TARGET_NAME ${_test_name}) | ||
set(TEST_TARGET_NAME ${PROJECT_NAME}-gtest-${TEST_TARGET_NAME}) | ||
|
||
message(STATUS | ||
"Adding gtest unittest \"${TEST_TARGET_NAME}\" with working dir ${PROJECT_SOURCE_DIR}/${TEST_FOLDER} \n _test: ${_test}" | ||
) | ||
|
||
add_executable(${TEST_TARGET_NAME} ${_test}) | ||
|
||
target_link_libraries(${TEST_TARGET_NAME} PUBLIC | ||
${GTEST_BOTH_LIBRARIES} pthread | ||
${PROJECT_NAME} | ||
) | ||
|
||
add_test(NAME ${TEST_TARGET_NAME} | ||
COMMAND ${TEST_TARGET_NAME} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
) | ||
endforeach() | ||
else() | ||
message(WARNING "GTest not found. Cannot compile tests!") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../version |
Oops, something went wrong.