IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
corsika
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antonio Augusto Alves Junior
corsika
Commits
01d9af14
Commit
01d9af14
authored
5 years ago
by
ralfulrich
Browse files
Options
Downloads
Patches
Plain Diff
try this...
parent
36cf8a2c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMakeLists.txt
+51
-27
51 additions, 27 deletions
CMakeLists.txt
with
51 additions
and
27 deletions
CMakeLists.txt
+
51
−
27
View file @
01d9af14
cmake_minimum_required
(
VERSION 3.9
)
# prevent in-source builds and give warning message
if
(
"
${
CMAKE_BINARY_DIR
}
"
STREQUAL
"
${
CMAKE_SOURCE_DIR
}
"
)
message
(
FATAL_ERROR
"In-source builds are disabled.
Please create a subfolder and use `cmake ..` inside it.
NOTE: cmake will now create CMakeCache.txt and CMakeFiles/*.
You must delete them, or cmake will refuse to work."
)
endif
()
project
(
corsika
VERSION 8.0.0
...
...
@@ -14,7 +22,7 @@ enable_language (Fortran)
set
(
CMAKE_INSTALL_MESSAGE LAZY
)
# directory for local cmake modules
set
(
CMAKE_MODULE_PATH
${
PROJECT_SOURCE_DIR
}
/CMakeModules
)
set
(
CMAKE_MODULE_PATH
${
PROJECT_SOURCE_DIR
}
/CMakeModules
)
include
(
CorsikaUtilities
)
# a few cmake function
set
(
CMAKE_CXX_STANDARD 17
)
...
...
@@ -22,50 +30,66 @@ set (CMAKE_CXX_EXTENSIONS OFF)
enable_testing
()
set
(
CTEST_OUTPUT_ON_FAILURE 1
)
option
(
COVERAGE
"Generate coverage data"
OFF
)
if
(
COVERAGE
)
set
(
CMAKE_BUILD_TYPE
"Debug"
)
endif
()
# add custom target to switch to "debug" build with "make debug"
ADD_CUSTOM_TARGET
(
debug
COMMAND
${
CMAKE_COMMAND
}
-DCMAKE_BUILD_TYPE=Debug
${
CMAKE_SOURCE_DIR
}
COMMAND
${
CMAKE_COMMAND
}
--build
${
CMAKE_BINARY_DIR
}
--target all
COMMENT
"Switch CMAKE_BUILD_TYPE to Debug"
)
# Set a default build type if none was specified
set
(
default_build_type
"Release"
)
if
(
EXISTS
"
${
CMAKE_SOURCE_DIR
}
/.git"
)
set
(
default_build_type
"Debug"
)
endif
()
# add custom target to switch to "release" build with "make release"
ADD_CUSTOM_TARGET
(
release
COMMAND
${
CMAKE_COMMAND
}
-DCMAKE_BUILD_TYPE=Release
${
CMAKE_SOURCE_DIR
}
COMMAND
${
CMAKE_COMMAND
}
--build
${
CMAKE_BINARY_DIR
}
--target all
COMMENT
"Switch CMAKE_BUILD_TYPE to Release"
)
if
(
NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES
)
message
(
STATUS
"Setting build type to '
${
default_build_type
}
' as no other was specified."
)
set
(
CMAKE_BUILD_TYPE
"
${
default_build_type
}
"
CACHE
# add custom target to switch to "coverage" build with "make coverage"
ADD_CUSTOM_TARGET
(
coverage
COMMAND
${
CMAKE_COMMAND
}
-DCMAKE_BUILD_TYPE=Coverage
${
CMAKE_SOURCE_DIR
}
COMMAND
${
CMAKE_COMMAND
}
--build
${
CMAKE_BINARY_DIR
}
--target all
COMMENT
"Switch CMAKE_BUILD_TYPE to Coverage"
)
# Set a default build type if none was specified
set
(
default_build_type
"Release"
)
if
(
EXISTS
"
${
CMAKE_SOURCE_DIR
}
/.git"
)
set
(
default_build_type
"Debug"
)
endif
()
if
(
NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES
)
message
(
STATUS
"Setting build type to '
${
default_build_type
}
' as no other was specified."
)
set
(
CMAKE_BUILD_TYPE
"
${
default_build_type
}
"
CACHE
STRING
"Choose the type of build."
FORCE
)
# Set the possible values of build type for cmake-gui
set_property
(
CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
set_property
(
CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug"
"Release"
"MinSizeRel"
"RelWithDebInfo"
)
endif
(
NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES
)
else
(
NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES
)
message
(
STATUS
"Build type is:
${
CMAKE_BUILD_TYPE
}
"
)
endif
(
NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES
)
# enable warnings and disallow non-standard language
set
(
CMAKE_CXX_FLAGS
"-Wall -pedantic -Wextra -Wno-ignored-qualifiers"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-O0 -g"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-O3 -g"
)
# -O2 would not trade speed for size, neither O2/3 use fast-math
set
(
CMAKE_Fortran_FLAGS
"-std=legacy"
)
set
(
CMAKE_CXX_FLAGS
"-Wall -pedantic -Wextra -Wno-ignored-qualifiers"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-O0 -g"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-O3 -g"
)
# -O2 would not trade speed for size, neither O2/3 use fast-math
set
(
CMAKE_Fortran_FLAGS
"-std=legacy"
)
# setup coverage target
set
(
CMAKE_CXX_FLAGS_COVERAGE
"
${
CMAKE_CXX_FLAGS_DEBUG
}
--coverage"
)
set
(
CMAKE_EXE_LINKER_FLAGS
"
${
CMAKE_EXE_LINKER_FLAGS_DEBUG
}
--coverage"
)
set
(
CMAKE_CXX_FLAGS_COVERAGE
"
-O0 -g
--coverage"
)
set
(
CMAKE_EXE_LINKER_FLAGS
_COVERAGE
"
--coverage"
)
# clang produces a lot of unecessary warnings without this:
add_compile_options
(
"$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wno-nonportable-include-path>"
)
add_compile_options
(
"$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wno-nonportable-include-path>"
)
# COAST - interface
if
(
WITH_COAST
)
message
(
STATUS
"Compiling CORSIKA8 for the use with COAST/corsika7."
)
add_compile_options
(
"-fPIC"
)
endif
()
message
(
STATUS
"Compiling CORSIKA8 for the use with COAST/corsika7."
)
add_compile_options
(
"-fPIC"
)
endif
()
#add_custom_target (corsika_pre_build)
#add_custom_command (TARGET corsika_pre_build PRE_BUILD COMMAND "${PROJECT_SOURCE_DIR}/pre_compile.py")
find_package
(
Pythia8
)
# optional
find_package
(
Eigen3 REQUIRED
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment