Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-alugrid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
ag-ohlberger
dune-community
dune-alugrid
Commits
c9563d54
Commit
c9563d54
authored
9 years ago
by
Martin Nolte
Browse files
Options
Downloads
Patches
Plain Diff
[CMake] create multiple targets for different configurations
parent
43228ea5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/CMakeLists.txt
+21
-27
21 additions, 27 deletions
examples/CMakeLists.txt
with
21 additions
and
27 deletions
examples/CMakeLists.txt
+
21
−
27
View file @
c9563d54
...
...
@@ -12,37 +12,31 @@ set(examples_HEADERS adaptation.hh
problem-euler.hh
problem.hh
)
set
(
EXAMPLES main_transport
main_ball
main_euler
)
# set default grid type and dimensions
add_definitions
(
"-DALUGRID_CUBE"
)
add_definitions
(
"-DGRIDDIM=3"
)
add_definitions
(
"-DWORLDDIM=3"
)
configure_file
(
alugrid.cfg
${
CMAKE_CURRENT_BINARY_DIR
}
/alugrid.cfg COPYONLY
)
add_executable
(
main_transport main.cc
)
add_dune_mpi_flags
(
main_transport
)
dune_target_link_libraries
(
main_transport
"
${
DUNE_LIBS
}
;
${
DUNE_ALUGRID_LIBRARY
}
"
)
set_property
(
TARGET main_transport APPEND PROPERTY
COMPILE_DEFINITIONS
"TRANSPORT"
)
add_executable
(
main_ball main.cc
)
add_dune_mpi_flags
(
main_ball
)
dune_target_link_libraries
(
main_ball
"
${
DUNE_LIBS
}
;
${
LIBRARIES
}
;
${
DUNE_ALUGRID_LIBRARY
}
"
)
set_property
(
TARGET main_ball APPEND PROPERTY
COMPILE_DEFINITIONS
"BALL"
)
add_executable
(
main_euler main.cc
)
add_dune_mpi_flags
(
main_euler
)
dune_target_link_libraries
(
main_euler
"
${
DUNE_LIBS
}
;
${
DUNE_ALUGRID_LIBRARY
}
"
)
set_property
(
TARGET main_euler APPEND PROPERTY
COMPILE_DEFINITIONS
"EULER"
)
foreach
(
variant ball euler transport
)
string
(
TOUPPER
${
variant
}
variant_upper
)
set
(
prog
"main_
${
variant
}
"
)
add_executable
(
${
prog
}
main.cc
)
target_compile_definitions
(
${
prog
}
PRIVATE
"
${
variant_upper
}
"
)
target_compile_definitions
(
${
prog
}
PUBLIC
"ALUGRID_CUBE"
"GRIDDIM=3"
"WORLDDIM=3"
)
add_dune_mpi_flags
(
${
prog
}
)
dune_target_link_libraries
(
${
prog
}
"
${
DUNE_LIBS
}
;
${
DUNE_ALUGRID_LIBRARY
}
"
)
foreach
(
type cube simplex
)
string
(
TOUPPER
${
type
}
type_upper
)
foreach
(
dim RANGE 2 3
)
set
(
prog
"main_
${
variant
}
_
${
type
}
_
${
dim
}
d"
)
add_executable
(
${
prog
}
EXCLUDE_FROM_ALL main.cc
)
target_compile_definitions
(
${
prog
}
PRIVATE
"
${
variant_upper
}
"
"ALUGRID_
${
type_upper
}
"
"GRIDDIM=
${
dim
}
"
"WORLDDIM=
${
dim
}
"
)
add_dune_mpi_flags
(
${
prog
}
)
dune_target_link_libraries
(
${
prog
}
"
${
DUNE_LIBS
}
;
${
DUNE_ALUGRID_LIBRARY
}
"
)
endforeach
()
endforeach
()
endforeach
()
install
(
FILES
${
examples_HEADERS
}
DESTINATION
${
examplesdir
}
)
foreach
(
i
${
SUBDIRS
}
)
if
(
${
i
}
STREQUAL
"test"
)
set
(
opt EXCLUDE_FROM_ALL
)
...
...
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