Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cdo
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor 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
mpim-sw
cdo
Commits
4e901695
Commit
4e901695
authored
2 months ago
by
Oliver Heidmann
Browse files
Options
Downloads
Patches
Plain Diff
cleanup and target specific compile definitions and linking
parent
a1c12d78
No related branches found
No related tags found
1 merge request
!312
CMake Improvements and fixes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/CMakeLists.txt
+22
-20
22 additions, 20 deletions
src/CMakeLists.txt
with
22 additions
and
20 deletions
src/CMakeLists.txt
+
22
−
20
View file @
4e901695
set
(
PACKAGE_NAME
"cdo"
)
set
(
VERSION
"
${
CMAKE_PROJECT_VERSION
}
"
)
add_subdirectory
(
lib
)
# -------- CDO LIB ------------
list
(
APPEND cdolib_src_files
after_fctrans.cc
after_namelist.cc
...
...
@@ -351,19 +350,16 @@ target_include_directories(cdolib
$<INSTALL_INTERFACE:
${
CMAKE_INSTALL_INCLUDEDIR
}
>
)
include_directories
(
"
${
PROJECT_SOURCE_DIR
}
/src/mpim_grid"
target_
include_directories
(
cdolib PRIVATE
"
${
PROJECT_SOURCE_DIR
}
/src/mpim_grid"
"
${
PROJECT_SOURCE_DIR
}
/src"
"
${
PROJECT_BINARY_DIR
}
/src"
"
${
PROJECT_SOURCE_DIR
}
/libcdi/src"
)
target_link_libraries
(
cdolib netCDF::netcdf
)
target_compile_definitions
(
cdolib PRIVATE HAVE_CONFIG_H restrict= CDI_SIZE_TYPE=size_t YAC_FOR_CDO
)
target_compile_definitions
(
cdolib PUBLIC HAVE_CONFIG_H restrict= CDI_SIZE_TYPE=size_t YAC_FOR_CDO
)
list
(
APPEND cdo_src_files cdo.cc
)
# --------------- CDO OPERATORS --------------------------------
list
(
APPEND cdo_operators_src_files
Afterburner.cc
Arith.cc
...
...
@@ -591,24 +587,30 @@ list( APPEND cdo_operators_src_files
Splitsel.cc
)
add_library
(
operators
${
cdo_operators_src_files
}
)
target_link_libraries
(
operators PUBLIC cdolib cdilib yac gradsdes healpix
)
add_executable
(
cdo
${
cdo_src_files
}
)
target_compile_definitions
(
cdo PUBLIC
list
(
APPEND cdo_compile_defs
restrict=
CDI_SIZE_TYPE=size_t
YAC_FOR_CDO
HAVE_CONFIG_H=1
VERSION=
"
${
VERSION
}
"
PACKAGE_NAME=
"
${
PACKAGE_NAME
}
"
)
PACKAGE_NAME=
"
${
PACKAGE_NAME
}
"
)
message
(
STATUS
"VERSION : "
${
VERSION
}
)
message
(
STATUS
"PACKAGE_NAME : "
${
PACKAGE_NAME
}
)
add_library
(
operators
${
cdo_operators_src_files
}
)
target_link_libraries
(
operators PUBLIC cdolib cdilib yac gradsdes healpix
)
target_compile_definitions
(
operators PRIVATE
${
cdo_compile_defs
}
)
target_include_directories
(
operators PRIVATE
"
${
PROJECT_SOURCE_DIR
}
/src/mpim_grid"
"
${
PROJECT_SOURCE_DIR
}
/libcdi/src"
"
${
PROJECT_SOURCE_DIR
}
/src/"
)
# --------------- CDO CLI EXECUTABLE --------------------------------
list
(
APPEND cdo_src_files cdo.cc
)
add_executable
(
cdo
${
cdo_src_files
}
)
target_compile_definitions
(
cdo PUBLIC
${
cdo_compile_defs
}
)
target_link_libraries
(
cdo PUBLIC
"$<LINK_LIBRARY:WHOLE_ARCHIVE,operators>"
)
target_link_libraries
(
cdo PUBLIC cdolib cdilib yac gradsdes healpix pthread
)
message
(
STATUS
"VERSION : "
${
VERSION
}
)
message
(
STATUS
"PACKAGE_NAME : "
${
PACKAGE_NAME
}
)
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