IAP GITLAB

Skip to content
Snippets Groups Projects
Commit afe83dc1 authored by ralfulrich's avatar ralfulrich
Browse files

added test main

parent 1d12f8ce
No related branches found
No related tags found
No related merge requests found
Pipeline #3157 failed
#################################
# Distribution of partly compressed data tables+files for air shower physics # Distribution of partly compressed data tables+files for air shower physics
# Ralf Ulrich, 2020
#
#################################
# This CMakeLists.txt may be included in your project
# to access corsika-data by adding
# add_subdirectory (corsika_data)
# to your CMakeLists.txt
# it creates the cmake taget "CorsikaData"
# and it builds the libCorsikaData.a archive.
#
##################################
# for standalong running
#
cmake_minimum_required (VERSION 3.9) cmake_minimum_required (VERSION 3.9)
project (CorsikaData) project (CorsikaData)
###################################
# set useful varialbles upstream
#
get_directory_property (hasParent PARENT_DIRECTORY) get_directory_property (hasParent PARENT_DIRECTORY)
if (hasParent) if (hasParent)
set (CorsikaData_DIR ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE) set (CorsikaData_DIR ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)
set (CorsikaData_VERSION "1.1.0" PARENT_SCOPE) set (CorsikaData_VERSION "1.1.0" PARENT_SCOPE)
endif (hasParent) endif (hasParent)
###################################
# CorsikaData requires to run with conan, typically inside CORSIKA8
#
if (NOT TARGET CONAN_PKG::bzip2) if (NOT TARGET CONAN_PKG::bzip2)
message (FATAL_ERROR "Please configure with conan bzip2 package") message (FATAL_ERROR "Please configure with conan bzip2 package")
endif (NOT TARGET CONAN_PKG::bzip2) endif (NOT TARGET CONAN_PKG::bzip2)
#
if (NOT TARGET CONAN_PKG::catch2) if (NOT TARGET CONAN_PKG::catch2)
message (FATAL_ERROR "Please configure with conan catch2 package") message (FATAL_ERROR "Please configure with conan catch2 package")
endif (NOT TARGET CONAN_PKG::catch2) endif (NOT TARGET CONAN_PKG::catch2)
...@@ -24,10 +45,4 @@ else (${CMAKE_VERSION} VERSION_LESS "3.12.0") ...@@ -24,10 +45,4 @@ else (${CMAKE_VERSION} VERSION_LESS "3.12.0")
set (CTEST_OUTPUT_ON_FAILURE 1) # this is for new versions of cmake set (CTEST_OUTPUT_ON_FAILURE 1) # this is for new versions of cmake
endif (${CMAKE_VERSION} VERSION_LESS "3.12.0") endif (${CMAKE_VERSION} VERSION_LESS "3.12.0")
# this may be included in our project to access corsika-data by adding
# add_subdirectory (corsika-data)
# to your CMakeLists.txt
# it creates the cmake taget "CorsikaData"
# and it builds the libCorsikaData.a archive.
add_subdirectory (readLib) add_subdirectory (readLib)
...@@ -33,15 +33,19 @@ install ( ...@@ -33,15 +33,19 @@ install (
# add unit test, if run inside CORSIKA # add unit test, if run inside CORSIKA
if (COMMAND CORSIKA_ADD_TEST) if (COMMAND CORSIKA_ADD_TEST)
message ("CorsikaData found CORSIKA_ADD_TEST")
if (CORSIKA_DATA_WITH_TEST) if (CORSIKA_DATA_WITH_TEST)
message ("CorsikaData, using CORSIKA_ADD_TEST")
CORSIKA_ADD_TEST (testData SOURCES source/testData.cc) CORSIKA_ADD_TEST (testData SOURCES source/testData.cc)
target_compile_definitions ( target_compile_definitions (
testData testData
PRIVATE PRIVATE
STANDALONE=1
TESTDATA="${CMAKE_CURRENT_SOURCE_DIR}/source/test.data" TESTDATA="${CMAKE_CURRENT_SOURCE_DIR}/source/test.data"
) )
endif (CORSIKA_DATA_WITH_TEST) endif (CORSIKA_DATA_WITH_TEST)
else (COMMAND CORSIKA_ADD_TEST) else (COMMAND CORSIKA_ADD_TEST)
message ("CorsikaData did not find CORSIKA_ADD_TEST")
add_executable (testData source/testData.cc) add_executable (testData source/testData.cc)
target_link_libraries (testData CorsikaData CONAN_PKG::catch2) target_link_libraries (testData CorsikaData CONAN_PKG::catch2)
target_compile_options (testData PRIVATE -g) # do not skip asserts target_compile_options (testData PRIVATE -g) # do not skip asserts
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment