Skip to content

Commit

Permalink
Make TribitsExampleProjectAddons its own TriBITS project (SAQUASH ME)…
Browse files Browse the repository at this point in the history
… (TriBITS TriBITSPub#73)

This pulls in TribitsExampleProject as a PRE extra repo.  This was super easy
to do!
  • Loading branch information
Roscoe A. Bartlett committed Jun 4, 2015
1 parent bb755a0 commit e8645ad
Show file tree
Hide file tree
Showing 7 changed files with 233 additions and 3 deletions.
135 changes: 132 additions & 3 deletions test/core/ExamplesUnitTests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1629,23 +1629,152 @@ TRIBITS_ADD_ADVANCED_TEST( TribitsExampleProject_TribitsExampleProjectAddons
-DTribitsExProj_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE=Continuous
TribitsExampleProject
PASS_REGULAR_EXPRESSION_ALL
"-- Adding POST extra Continuous repository TribitsExampleProjectAddons"
"Reading the list of packages from .*/TribitsExampleProject/TribitsExampleProjectAddons/PackagesList.cmake"
"-- Adding POST extra Continuous repository TribitsExampleProjectAddons "
"Reading the list of packages from .*/TribitsExampleProject/PackagesList.cmake"
"Reading the list of TPLs from .*/TribitsExampleProject/TPLsList.cmake"
"Reading a list of extra packages from .*/TribitsExampleProject/TribitsExampleProjectAddons/PackagesList.cmake"
"Reading a list of extra TPLs from .*/TribitsExampleProject/TribitsExampleProjectAddons/TPLsList.cmake"
"Final set of enabled SE packages: SimpleCxx .* Addon1"
"Processing enabled package: SimpleCxx [(]Libs, Tests, Examples[)]"
"Processing enabled package: Addon1 [(]Libs, Tests, Examples[)]"
"Configuring done"
"Generating done"

TEST_3 CMND make
ARGS ${CTEST_BUILD_FLAGS}
PASS_REGULAR_EXPRESSION_ALL
"Scanning dependencies of target addon1"
"Linking CXX executable Addon1_test.exe"
"Built target Addon1_test"

TEST_4 CMND ${CMAKE_CTEST_COMMAND} ARGS -VV
PASS_REGULAR_EXPRESSION_ALL
"Test .*: Addon1_test .* Passed"
"100% tests passed, 0 tests failed out of"

TEST_5 CMND make
ARGS ${CTEST_BUILD_FLAGS} clean

TEST_6
MESSAGE "Configure again enabling all packages using TribitsExProj_EXTRA_REPOSITORIES only"
CMND ${CMAKE_COMMAND}
ARGS
${COMMON_ENV_ARGS_PASSTHROUGH}
-DTribitsExProj_EXTRAREPOS_FILE=
-DTribitsExProj_EXTRA_REPOSITORIES=TribitsExampleProjectAddons
.
PASS_REGULAR_EXPRESSION_ALL
"Processing list of POST extra repos from TribitsExProj_EXTRA_REPOSITORIES='TribitsExampleProjectAddons'"
"Reading the list of packages from .*/TribitsExampleProject/PackagesList.cmake"
"Reading the list of TPLs from .*/TribitsExampleProject/TPLsList.cmake"
"Reading a list of extra packages from .*/TribitsExampleProject/TribitsExampleProjectAddons/PackagesList.cmake"
"Reading a list of extra TPLs from .*/TribitsExampleProject/TribitsExampleProjectAddons/TPLsList.cmake"
"Final set of enabled SE packages: SimpleCxx .* Addon1"
"Processing enabled package: SimpleCxx [(]Libs, Tests, Examples[)]"
"Processing enabled package: Addon1 [(]Libs, Tests, Examples[)]"
"Configuring done"
"Generating done"

TEST_7 CMND make
ARGS ${CTEST_BUILD_FLAGS}
PASS_REGULAR_EXPRESSION_ALL
"Linking CXX executable Addon1_test.exe"
"Built target Addon1_test"

TEST_8 CMND ${CMAKE_CTEST_COMMAND} ARGS -VV
PASS_REGULAR_EXPRESSION_ALL
"Test .*: Addon1_test .* Passed"
"100% tests passed, 0 tests failed out of"

)


########################################################################
# TribitsExampleProjectAddons
########################################################################


TRIBITS_ADD_ADVANCED_TEST( TribitsExampleProjectAddons
OVERALL_WORKING_DIRECTORY TEST_NAME
OVERALL_NUM_MPI_PROCS 1

TEST_0
MESSAGE "Copy TribitsExampleProjectAddons"
CMND cp
ARGS -r ${${PROJECT_NAME}_TRIBITS_DIR}/examples/TribitsExampleProjectAddons .

TEST_1
MESSAGE "Copy TribitsExampleProject to base dir"
CMND cp
ARGS -r ${${PROJECT_NAME}_TRIBITS_DIR}/examples/TribitsExampleProject
TribitsExampleProjectAddons/.

TEST_2
MESSAGE "Configure enabling all packages using cmake/ExtraRepositoriesList.cmake"
CMND ${CMAKE_COMMAND}
ARGS
${COMMON_ENV_ARGS_PASSTHROUGH}
-DTribitsExProjAddons_TRIBITS_DIR=${${PROJECT_NAME}_TRIBITS_DIR}
-DTribitsExProjAddons_ENABLE_Fortran=OFF
-DTribitsExProjAddons_ENABLE_DEBUG=OFF
-DTribitsExProjAddons_ENABLE_ALL_PACKAGES=ON
-DTribitsExProjAddons_ENABLE_TESTS=ON
TribitsExampleProjectAddons
PASS_REGULAR_EXPRESSION_ALL
"Reading the list of extra repositories from cmake/ExtraRepositoriesList.cmake"
"-- Adding PRE extra Continuous repository TribitsExampleProject "
"Reading a list of extra packages from .*/TribitsExampleProjectAddons/TribitsExampleProject/PackagesList.cmake"
"Reading a list of extra TPLs from .*/TribitsExampleProjectAddons/TribitsExampleProject/TPLsList.cmake"
"Reading the list of packages from .*/TribitsExampleProjectAddons/PackagesList.cmake"
"Reading the list of TPLs from .*/TribitsExampleProjectAddons/TPLsList.cmake"
"Final set of enabled SE packages: SimpleCxx .* Addon1"
"Processing enabled package: SimpleCxx [(]Libs, Tests, Examples[)]"
"Processing enabled package: Addon1 [(]Libs, Tests, Examples[)]"
"Configuring done"
"Generating done"

TEST_3 CMND make
ARGS ${CTEST_BUILD_FLAGS}
PASS_REGULAR_EXPRESSION_ALL
"Linking CXX executable Addon1_test.exe"
"Built target Addon1_test"

TEST_4 CMND ${CMAKE_CTEST_COMMAND} ARGS -VV
PASS_REGULAR_EXPRESSION_ALL
"Test .*: Addon1_test .* Passed"
"100% tests passed, 0 tests failed out of"

TEST_5 CMND make
ARGS ${CTEST_BUILD_FLAGS} clean

TEST_6
MESSAGE "Configure again enabling all packages using TribitsExProjAddons_PRE_REPOSITORIES only"
CMND ${CMAKE_COMMAND}
ARGS
${COMMON_ENV_ARGS_PASSTHROUGH}
-DTribitsExProjAddons_EXTRAREPOS_FILE=
-DTribitsExProjAddons_PRE_REPOSITORIES=TribitsExampleProject
.
PASS_REGULAR_EXPRESSION_ALL
"Processing list of PRE extra repos from TribitsExProjAddons_PRE_REPOSITORIES='TribitsExampleProject'"
"Reading a list of extra packages from .*/TribitsExampleProjectAddons/TribitsExampleProject/PackagesList.cmake"
"Reading a list of extra TPLs from .*/TribitsExampleProjectAddons/TribitsExampleProject/TPLsList.cmake"
"Reading the list of packages from .*/TribitsExampleProjectAddons/PackagesList.cmake"
"Reading the list of TPLs from .*/TribitsExampleProjectAddons/TPLsList.cmake"
"Final set of enabled SE packages: SimpleCxx .* Addon1"
"Processing enabled package: SimpleCxx [(]Libs, Tests, Examples[)]"
"Processing enabled package: Addon1 [(]Libs, Tests, Examples[)]"
"Configuring done"
"Generating done"

TEST_7 CMND make
ARGS ${CTEST_BUILD_FLAGS}
PASS_REGULAR_EXPRESSION_ALL
"Linking CXX executable Addon1_test.exe"
"Built target Addon1_test"

TEST_8 CMND ${CMAKE_CTEST_COMMAND} ARGS -VV
PASS_REGULAR_EXPRESSION_ALL
"Test .*: Addon1_test .* Passed"
"100% tests passed, 0 tests failed out of"

)
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,21 @@ MACRO(TRIBITS_GET_AND_PROCESS_EXTRA_REPOSITORIES_LISTS)
${${PROJECT_NAME}_EXTRA_REPOSITORIES_DEFAULT})
ENDIF()

ELSE()

IF (${PROJECT_NAME}_PRE_REPOSITORIES OR ${PROJECT_NAME}_EXTRA_REPOSITORIES)
MESSAGE("")
IF (${PROJECT_NAME}_PRE_REPOSITORIES)
MESSAGE("Processing list of PRE extra repos from ${PROJECT_NAME}_PRE_REPOSITORIES"
"='${${PROJECT_NAME}_PRE_REPOSITORIES}' ...")
ENDIF()
IF (${PROJECT_NAME}_EXTRA_REPOSITORIES)
MESSAGE("Processing list of POST extra repos from ${PROJECT_NAME}_EXTRA_REPOSITORIES"
"='${${PROJECT_NAME}_EXTRA_REPOSITORIES}' ...")
ENDIF()
MESSAGE("")
ENDIF()

ENDIF()

ENDMACRO()
Expand Down
46 changes: 46 additions & 0 deletions tribits/examples/TribitsExampleProjectAddons/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
################################################################################
# #
# TribitsExampleProjectAddons #
# #
################################################################################

# To be safe, define your minimum CMake version. This may be newer than the
# min required by TriBITS.
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11 FATAL_ERROR)

# Make CMake set WIN32 with CYGWIN for older CMake versions. CMake requires
# this to be in the top-level CMakeLists.txt file and not an include file :-(
SET(CMAKE_LEGACY_CYGWIN_WIN32 1 CACHE BOOL "" FORCE)

#
# A) Define your project name and set up major project options
#
# NOTE: Don't set options that would impact what packages get defined or
# enabled/disabled in this file as that would not impact other tools that
# don't process this file.
#

# Get PROJECT_NAME (must be in a file for other parts of system to read)
INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/ProjectName.cmake")

# CMake requires that you declare the CMake project in the top-level file and
# not in an include file :-(
PROJECT(${PROJECT_NAME} NONE)

#
# B) Pull in the TriBITS system and execute
#

SET(${PROJECT_NAME}_TRIBITS_DIR
"${CMAKE_CURRENT_LIST_DIR}/../.." CACHE STRING
"TriBITS base directory (default assumes in TriBITS source tree)")
INCLUDE("${${PROJECT_NAME}_TRIBITS_DIR}/TriBITS.cmake")

# Set default location for header-only TPL to make easy to configure out of
# the TriBITS source tree.
SET(HeaderOnlyTpl_INCLUDE_DIRS
"${${PROJECT_NAME}_TRIBITS_DIR}/examples/tpls/HeaderOnlyTpl"
CACHE PATH "Default set by TriBITS/CMakeLists.txt" )

# Do all of the processing for this Tribits project
TRIBITS_PROJECT()
11 changes: 11 additions & 0 deletions tribits/examples/TribitsExampleProjectAddons/ProjectName.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Must set the project name at very beginning before including anything else
SET(PROJECT_NAME TribitsExProjAddons)

# Turn on export depenency generation for WrapExteranl package
SET(${PROJECT_NAME}_GENERATE_EXPORT_FILE_DEPENDENCIES_DEFAULT ON)

# Must always have the PRE extra repo TribitsExampleProject/ or can't build
SET(${PROJECT_NAME}_EXTRAREPOS_FILE cmake/ExtraRepositoriesList.cmake
CACHE FILEPATH "Set in ProjectName.cmake")
SET(${PROJECT_NAME}_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE Continuous
CACHE STRING "Set in ProjectName.cmake")
21 changes: 21 additions & 0 deletions tribits/examples/TribitsExampleProjectAddons/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# TribitsExampleProjectAddons Documentation
#

WARNING: WORK IN PROGRESS! This TriBITS example project will get fleshed out
more in the future to be more complete.

The project TribitsExampleProjectAddons defines a TriBITS CMake project
designed to provide a simple example to demonstrate how to use extra
repositories with the TriBITS system.

To get started building you can create a directory structure like:

~/TribitsExampleProjectAddons.base/
TribitsExampleProjectAddons/ # This directory
TribitsExampleProject/ # Copied in TribitsExampleProject/ dir
BUILDS/
GCC-<X.Y.Z>/
MPI_DEBUG/

ToDo: Finish documentation!
5 changes: 5 additions & 0 deletions tribits/examples/TribitsExampleProjectAddons/Version.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SET(${REPOSITORY_NAME}_VERSION 1.1)
SET(${REPOSITORY_NAME}_MAJOR_VERSION 01)
SET(${REPOSITORY_NAME}_MAJOR_MINOR_VERSION 010100)
SET(${REPOSITORY_NAME}_VERSION_STRING "1.1 (Dev)")
SET(${REPOSITORY_NAME}_ENABLE_DEVELOPMENT_MODE_DEFAULT ON) # Change to 'OFF' for a release
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TRIBITS_PROJECT_DEFINE_EXTRA_REPOSITORIES(
TribitsExampleProject "" GIT dummy-git-url PRE Continuous
)

0 comments on commit e8645ad

Please sign in to comment.