| 1 |
cmake_minimum_required(VERSION 3.23.1) |
| 2 |
|
| 3 |
project(TribitsExApp |
| 4 |
DESCRIPTION |
| 5 |
"Example raw CMake project using packages installed from TribitsExampleProject" |
| 6 |
VERSION 0.0.0 |
| 7 |
LANGUAGES NONE # Defined below after reading in compilers |
| 8 |
) |
| 9 |
|
| 10 |
set(${PROJECT_NAME}_USE_COMPONENTS "" CACHE STRING |
| 11 |
"Components/Packages to use from TribitsExampleProject: <C0>,<C1>,..." ) |
| 12 |
string(REPLACE "," ";" ${PROJECT_NAME}_USE_COMPONENTS |
| 13 |
"${${PROJECT_NAME}_USE_COMPONENTS}") |
| 14 |
|
| 15 |
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") |
| 16 |
include(AppHelperFuncs) |
| 17 |
|
| 18 |
getTribitsExProjStuffForApp() |
| 19 |
|
| 20 |
# Show that we can see exported cache vars |
| 21 |
message("-- WithSubpackagesA_SPECIAL_VALUE = '${WithSubpackagesA_SPECIAL_VALUE}'") |
| 22 |
|
| 23 |
# Enable the compilers now that we have gotten them from the *Config.cmake file |
| 24 |
enable_language(C) |
| 25 |
enable_language(CXX) |
| 26 |
if (CMAKE_Fortran_COMPILER) |
| 27 |
enable_language(Fortran) |
| 28 |
endif() |
| 29 |
|
| 30 |
# Build the APP and link to libraries from TribitsExProj packages |
| 31 |
add_executable(app app.cpp) |
| 32 |
target_link_libraries(app PRIVATE ${APP_DEPS_LIB_TARGETS}) |
| 33 |
addAppDepCompileDefines() |
| 34 |
|
| 35 |
# Set up tests |
| 36 |
|
| 37 |
enable_testing() |
| 38 |
|
| 39 |
getExpectedAppDepsStr(expectedDepsStr) |
| 40 |
|
| 41 |
add_test(app_test app) |
| 42 |
set_tests_properties(app_test PROPERTIES |
| 43 |
PASS_REGULAR_EXPRESSION "Full Deps: ${expectedDepsStr}" |
| 44 |
) |