Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
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
Container 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-xt
Commits
96a4cff1
Commit
96a4cff1
authored
10 years ago
by
Felix Schindler
Browse files
Options
Downloads
Patches
Plain Diff
[cmake] added support for good old times with -DCMAKE_WITH_AUTOTOOLS=1
parent
184bdcc4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMakeLists.txt
+116
-40
116 additions, 40 deletions
CMakeLists.txt
with
116 additions
and
40 deletions
CMakeLists.txt
+
116
−
40
View file @
96a4cff1
...
@@ -5,56 +5,132 @@
...
@@ -5,56 +5,132 @@
project
(
"dune-stuff"
CXX
)
project
(
"dune-stuff"
CXX
)
# cmake specific
if
(
CMAKE_WITH_AUTOTOOLS
)
cmake_minimum_required
(
VERSION 2.8
)
# this is how it used to be in the good old days :)
# this assumes that we use autotools to configure everything and just use this CMakeLists.txt for the tests and
# examples in dune-gdt
if
(
NOT CMAKE_BUILD_TYPE
)
message
(
STATUS
"No build type selected, setting default build type 'Debug'"
)
set
(
CMAKE_BUILD_TYPE
"DEBUG"
CACHE STRING
"DEBUG/RELEASE"
)
endif
(
NOT CMAKE_BUILD_TYPE
)
set
(
CMAKE_COLOR_MAKEFILE ON
)
# cmake specific
cmake_minimum_required
(
VERSION 2.8
)
set
(
CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true
)
set
(
CMAKE_FIND_LIBRARY_SUFFIXES
".so"
".lib"
".la"
".a"
)
set
(
CMAKE_COLOR_MAKEFILE ON
)
set
(
CMAKE_VERBOSE_MAKEFILE ON
)
# guess dune-common build dir
# local environment
if
(
NOT
(
dune-common_DIR OR dune-common_ROOT OR
set
(
ENV{PATH}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../local/bin:$ENV{PATH}"
)
"
${
CMAKE_PREFIX_PATH
}
"
MATCHES
".*dune-common.*"
))
set
(
ENV{LD_LIBRARY_PATH}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../local/lib:$ENV{LD_LIBRARY_PATH}"
)
string
(
REPLACE
${
CMAKE_PROJECT_NAME
}
dune-common dune-common_DIR
set
(
ENV{PKG_CONFIG_PATH}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../local/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}"
)
${
PROJECT_BINARY_DIR
}
)
endif
()
#find dune-common and set the module path
# needs to come first to include correct config.h
find_package
(
dune-common REQUIRED
)
include_directories
(
${
dune-stuff_SOURCE_DIR
}
)
list
(
APPEND CMAKE_MODULE_PATH
${
dune-common_MODULE_PATH
}
include_directories
(
${
dune-stuff_BINARY_DIR
}
)
"
${
PROJECT_SOURCE_DIR
}
/cmake/modules"
)
#include the dune macros
# dune-stuff cmake includes
include
(
DuneMacros
)
set
(
CMAKE_MODULE_PATH
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake/modules
)
include
(
DuneUtils
)
include
(
GridUtils
)
# start a dune project with information from dune.module
# we would like to have fasp
dune_project
(
)
#include(FindFASP
)
# dune-stuff cmake includes
add_dune_modules
(
list
(
APPEND CMAKE_MODULE_PATH
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake
)
stuff
common
pdelab
typetree
fem
istl
geometry
grid
localfunctions
)
#----------------------------------------------------------------------------------------------------
# header
# General Settings
file
(
GLOB_RECURSE stuff
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/*.hh"
)
#----------------------------------------------------------------------------------------------------
set
(
COMMON_HEADER
${
stuff
}
${
DUNE_HEADERS
}
)
execute_process
(
set_source_files_properties
(
${
COMMON_HEADER
}
PROPERTIES HEADER_FILE_ONLY 1
)
COMMAND
${
CMAKE_SOURCE_DIR
}
/getRevision.sh
OUTPUT_VARIABLE COMMIT
ERROR_VARIABLE shell_error
OUTPUT_STRIP_TRAILING_WHITESPACE
)
include
(
DuneUtils
)
# libs
# configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/cmake_config.h )
set
(
COMMON_LIBS
${
DUNE_LIBS
}
${
DUNE_DEFAULT_LIBS
}
${
PARALIBS
}
${
CCGNU_LIBRARIES
}
${
Boost_SYSTEM_LIBS
}
${
GRIDLIBS
}
${
FASPLIB
}
)
add_subdirectory
(
dune/stuff/test
)
link_directories
(
"/usr/lib"
${
CCGNU_LIBRARY_DIRS
}
)
ADD_EXECUTABLE
(
this_needs_to_be_here_to_have_header_listing_until_we_have_a_real_executable
"dune/stuff/test/common_color.cc"
${
COMMON_HEADER
}
)
TARGET_LINK_LIBRARIES
(
this_needs_to_be_here_to_have_header_listing_until_we_have_a_real_executable
${
COMMON_LIBS
}
)
# header
else
(
CMAKE_WITH_AUTOTOOLS
)
file
(
GLOB_RECURSE stuff
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/dune/*.hh"
)
# this assumes that we run dunecontrol with the --use-cmake option
set
(
COMMON_HEADER
${
stuff
}
${
DUNE_HEADERS
}
)
set_source_files_properties
(
${
COMMON_HEADER
}
PROPERTIES HEADER_FILE_ONLY 1
)
add_subdirectory
(
dune
)
# cmake specific
#add_subdirectory(examples)
cmake_minimum_required
(
VERSION 2.8
)
add_subdirectory
(
"cmake/modules"
)
add_subdirectory
(
"cmake/scripts"
)
finalize_dune_project
(
GENERATE_CONFIG_H_CMAKE
)
set
(
CMAKE_COLOR_MAKEFILE ON
)
# guess dune-common build dir
if
(
NOT
(
dune-common_DIR OR dune-common_ROOT OR
"
${
CMAKE_PREFIX_PATH
}
"
MATCHES
".*dune-common.*"
))
string
(
REPLACE
${
CMAKE_PROJECT_NAME
}
dune-common dune-common_DIR
${
PROJECT_BINARY_DIR
}
)
endif
()
#find dune-common and set the module path
find_package
(
dune-common REQUIRED
)
list
(
APPEND CMAKE_MODULE_PATH
${
dune-common_MODULE_PATH
}
"
${
PROJECT_SOURCE_DIR
}
/cmake/modules"
)
#include the dune macros
include
(
DuneMacros
)
# start a dune project with information from dune.module
dune_project
()
# dune-stuff cmake includes
list
(
APPEND CMAKE_MODULE_PATH
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake
)
#----------------------------------------------------------------------------------------------------
# General Settings
#----------------------------------------------------------------------------------------------------
execute_process
(
COMMAND
${
CMAKE_SOURCE_DIR
}
/getRevision.sh
OUTPUT_VARIABLE COMMIT
ERROR_VARIABLE shell_error
OUTPUT_STRIP_TRAILING_WHITESPACE
)
include
(
DuneUtils
)
# configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/cmake_config.h )
link_directories
(
"/usr/lib"
${
CCGNU_LIBRARY_DIRS
}
)
# header
file
(
GLOB_RECURSE stuff
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/dune/*.hh"
)
set
(
COMMON_HEADER
${
stuff
}
${
DUNE_HEADERS
}
)
set_source_files_properties
(
${
COMMON_HEADER
}
PROPERTIES HEADER_FILE_ONLY 1
)
add_subdirectory
(
dune
)
#add_subdirectory(examples)
add_subdirectory
(
"cmake/modules"
)
add_subdirectory
(
"cmake/scripts"
)
finalize_dune_project
(
GENERATE_CONFIG_H_CMAKE
)
endif
(
CMAKE_WITH_AUTOTOOLS
)
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