Skip to content

Commit

Permalink
Merge pull request #31 from njoy/party
Browse files Browse the repository at this point in the history
Updated to newer version of FetchContent build system.
  • Loading branch information
jlconlin authored Oct 29, 2020
2 parents cc83f61 + 521a6d0 commit 97224cd
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 18 deletions.
28 changes: 26 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,44 @@ set( CMAKE_CXX_STANDARD_REQUIRED YES )
option( elementary_unit_tests
"Compile the elementary unit tests and integrate with ctest" ON
)
option( strict_compile
"Treat all warnings as errors." ON
)

# Compile flags
set( common_flags "-Wall" "-Wextra" "-Wpedantic" )
set( strict_flags "-Werror" )
set( release_flags "-O3" )
set( debug_flags "-O0" "-g" )


########################################################################
# Dependencies
########################################################################

include( cmake/elementary_dependencies.cmake )
set( REPOSITORIES "release"
CACHE STRING
"Options for where to fetch repositories: develop, release, local"
)

if( REPOSITORIES STREQUAL "develop" )
include( cmake/develop_dependencies.cmake )

elseif( REPOSITORIES STREQUAL "release" )
include( cmake/release_dependencies.cmake )

elseif( REPOSITORIES STREQUAL "local" )
include( cmake/local_dependencies.cmake )

endif()


########################################################################
# Project targets
########################################################################

add_library( elementary INTERFACE )
add_library( elementary INTERFACE
)
target_include_directories( elementary INTERFACE src/ )
target_link_libraries( elementary
INTERFACE catch-adapter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
cmake_minimum_required( VERSION 3.14 )

include( FetchContent )


#######################################################################
# Forward declarations
#######################################################################



#######################################################################
# Declare project dependencies
#######################################################################

FetchContent_Declare( catch-adapter
GIT_REPOSITORY https://github.com/njoy/catch-adapter
GIT_TAG origin/build/fetchcontent
GIT_TAG origin/master
GIT_SHALLOW TRUE
)

Expand Down
19 changes: 19 additions & 0 deletions cmake/release_dependencies.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cmake_minimum_required( VERSION 3.14 )
include( FetchContent )

#######################################################################
# Declare project dependencies
#######################################################################

FetchContent_Declare( catch-adapter
GIT_REPOSITORY https://github.com/njoy/catch-adapter
GIT_TAG fb84b82ebf7a4789aa43cea560680cf745c6ee4f
)

#######################################################################
# Load dependencies
#######################################################################

FetchContent_MakeAvailable(
catch-adapter
)
15 changes: 8 additions & 7 deletions cmake/unit_testing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@
# Setup
#######################################################################

message( STATUS "Adding unit testing" )
message( STATUS "Adding elementary unit testing" )
enable_testing()


#######################################################################
# Unit testing directories
#######################################################################
add_subdirectory( src/elementary/Level/test )
add_subdirectory( src/elementary/Identifier/test )
add_subdirectory( src/elementary/FundamentalParticleID/test )

add_subdirectory( src/elementary/ElementID/test )
add_subdirectory( src/elementary/FundamentalParticleID/test )
add_subdirectory( src/elementary/Identifier/test )
add_subdirectory( src/elementary/IsotopeID/test )
add_subdirectory( src/elementary/NuclideID/test )
add_subdirectory( src/elementary/Level/test )
add_subdirectory( src/elementary/NucleusID/test )
add_subdirectory( src/elementary/NuclideID/test )
add_subdirectory( src/elementary/ParticleID/test )
add_subdirectory( src/elementary/ParticleTupleID/test )
add_subdirectory( src/elementary/ParticlePairID/test )
add_subdirectory( src/elementary/ReactionType/test )
add_subdirectory( src/elementary/ParticleTupleID/test )
add_subdirectory( src/elementary/ReactionID/test )
add_subdirectory( src/elementary/ReactionType/test )
add_subdirectory( src/elementary/test )

0 comments on commit 97224cd

Please sign in to comment.