-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
323b308
commit 43f8214
Showing
4 changed files
with
29 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,35 @@ | ||
STRING(REGEX REPLACE ".*/(.*)" "\\1" CURRENT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}) | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${SPHINXSYS_PROJECT_DIR}/cmake) # main (top) cmake dir | ||
|
||
set(CMAKE_VERBOSE_MAKEFILE on) | ||
|
||
STRING( REGEX REPLACE ".*/(.*)" "\\1" CURRENT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR} ) | ||
PROJECT("${CURRENT_FOLDER}") | ||
|
||
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) | ||
SET(EXECUTABLE_OUTPUT_PATH "${PROJECT_BINARY_DIR}/bin/") | ||
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) | ||
SET(BUILD_INPUT_PATH "${EXECUTABLE_OUTPUT_PATH}/input") | ||
SET(BUILD_RELOAD_PATH "${EXECUTABLE_OUTPUT_PATH}/reload") | ||
|
||
|
||
|
||
|
||
add_executable(${PROJECT_NAME}) | ||
aux_source_directory(. DIR_SRCS) | ||
target_sources(${PROJECT_NAME} PRIVATE ${DIR_SRCS}) | ||
ADD_EXECUTABLE(${PROJECT_NAME} ${DIR_SRCS}) | ||
|
||
target_link_libraries(${PROJECT_NAME} sphinxsys_2d GTest::gtest GTest::gtest_main) | ||
target_link_libraries(${PROJECT_NAME} extra_sources_2d) | ||
|
||
set_target_properties(${PROJECT_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${EXECUTABLE_OUTPUT_PATH}") | ||
|
||
add_test(NAME ${PROJECT_NAME} | ||
COMMAND ${PROJECT_NAME} | ||
WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) | ||
|
||
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") | ||
add_test(NAME ${PROJECT_NAME}_particle_relaxation COMMAND ${PROJECT_NAME} --r=true | ||
WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) | ||
add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME} --r=false --i=true | ||
WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) | ||
else() | ||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/run_test.sh | ||
DESTINATION ${EXECUTABLE_OUTPUT_PATH}) | ||
add_test(NAME ${PROJECT_NAME} COMMAND bash ${EXECUTABLE_OUTPUT_PATH}/run_test.sh | ||
WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) | ||
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,2 @@ | ||
./xj_stretching --r=true | ||
./xj_stretching --r=false --i=true |
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