Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ProMod3
Manage
Activity
Members
Plan
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository 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
schwede
ProMod3
Commits
b698f491
Commit
b698f491
authored
11 years ago
by
Bienchen
Browse files
Options
Downloads
Patches
Plain Diff
First setup of CMake, already has out-of-source build enabled
parent
22f19f54
No related branches found
No related tags found
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
CMakeLists.txt
+65
-3
65 additions, 3 deletions
CMakeLists.txt
cmake_support/FindPython.cmake
+27
-11
27 additions, 11 deletions
cmake_support/FindPython.cmake
cmake_support/PROMOD.cmake
+868
-0
868 additions, 0 deletions
cmake_support/PROMOD.cmake
with
961 additions
and
14 deletions
.gitignore
+
1
−
0
View file @
b698f491
junk.py
stage/
This diff is collapsed.
Click to expand it.
CMakeLists.txt
+
65
−
3
View file @
b698f491
...
...
@@ -2,9 +2,71 @@
# Author: Stefan Bienert
#-------------------------------------------------------------------------------
cmake_minimum_required
(
VERSION 2.6.4 FATAL_ERROR
)
set
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
${
CMAKE_SOURCE_DIR
}
/cmake_support
)
project
(
PROMOD
2
)
project
(
PROMOD
3 CXX C
)
set
(
PROMOD2_VERSION_MAJOR 0
)
set
(
PROMOD2_VERSION_MINOR 0
)
include
(
PROMOD
)
set
(
PROMOD3_VERSION_MAJOR 0
)
set
(
PROMOD3_VERSION_MINOR 0
)
set
(
PROMOD_VERSION_STRING
${
PROMOD3_VERSION_MAJOR
}
.
${
PROMOD3_VERSION_MINOR
}
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
exec_program
(
gcc ARGS --version OUTPUT_VARIABLE CMAKE_C_COMPILER_VERSION
)
if
(
CMAKE_C_COMPILER_VERSION MATCHES
".*4
\\
.[5-9].*"
)
set
(
PROMOD_GCC_45 true
)
else
()
set
(
PROMOD_GCC_45 false
)
endif
()
endif
()
if
(
OPTIMIZE
)
set
(
CMAKE_BUILD_TYPE Release
)
set
(
_OPT ON
)
else
()
set
(
CMAKE_BUILD_TYPE Debug
)
set
(
_OPT OFF
)
endif
()
setup_stage
()
file
(
MAKE_DIRECTORY
${
STAGE_DIR
}
${
EXECUTABLE_OUTPUT_PATH
}
${
HEADER_STAGE_PATH
}
${
LIB_STAGE_PATH
}
${
LIBEXEC_STAGE_PATH
}
)
setup_compiler_flags
()
setup_boost
()
find_package
(
Python 2.7 REQUIRED
)
find_package
(
OPENSTRUCTURE 1.4 REQUIRED
COMPONENTS io mol seq seq_alg mol_alg conop
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
# do not write back into cache, otherwise the compile command line gets
# expanded with multiple -fno-strict-aliasing flags, triggering a complete
# rebuild whenever cmake is run
set
(
CMAKE_CXX_FLAGS_RELEASE
"
${
CMAKE_CXX_FLAGS_RELEASE
}
-fno-strict-aliasing"
)
if
(
"
${
CMAKE_CXX_COMPILER_VERSION
}
"
VERSION_GREATER
"4.6"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-attributes"
)
endif
(
"
${
CMAKE_CXX_COMPILER_VERSION
}
"
VERSION_GREATER
"4.6"
)
endif
()
# basic environment
include_directories
(
${
Boost_INCLUDE_DIRS
}
${
OST_INCLUDE_DIR
}
)
set
(
FILES_TO_BE_REMOVED
${
CMAKE_SOURCE_DIR
}
/stage
)
set_directory_properties
(
PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
"
${
FILES_TO_BE_REMOVED
}
"
)
## sub dirs to be recognised by CMake
## e.g. add_subdirectory(src), subdirs have thier own CMakeLists.txt
add_subdirectory
(
meld
)
## report setup
message
(
STATUS
"PROMOD3 will be built with the following options:
\n
"
" OpenStructure (-DOST_ROOT) :
${
OST_ROOT
}
\n
"
" Optimized (-DOPTIMIZE) :
${
_OPT
}
\n
"
" Python :
${
PYTHON_BINARY
}
\n
"
)
This diff is collapsed.
Click to expand it.
cmake_support/FindPython.cmake
+
27
−
11
View file @
b698f491
...
...
@@ -17,8 +17,8 @@
# Author: Marco Biasini
#-------------------------------------------------------------------------------
set
(
PYTHON_VERSIONS 2.7
2.6 2.5 2.4 2.3 2.2
)
set
(
PYTHON_MIN_VERSION 2.
2.1
)
set
(
PYTHON_VERSIONS 2.7
)
set
(
PYTHON_MIN_VERSION 2.
7
)
#-------------------------------------------------------------------------------
# check for python framework
...
...
@@ -42,12 +42,12 @@ endmacro()
macro
(
_find_python PYTHON_ROOT VERSION
)
string
(
REPLACE
"."
""
_VERSION_NO_DOTS
${
VERSION
}
)
string
(
REPLACE
"."
""
_VERSION_NO_DOTS
"
${
VERSION
}
"
)
if
(
PYTHON_ROOT
)
find_library
(
PYTHON_LIBRARIES
NAMES
"python
${
_VERSION_NO_DOTS
}
"
"python
${
VERSION
}
"
HINTS
"
${
PYTHON_ROOT
}
"
PATH_SUFFIXES lib
PATH_SUFFIXES lib
libs
NO_SYSTEM_ENVIRONMENT_PATH NO_DEFAULT_PATH
)
find_path
(
PYTHON_INCLUDE_PATH
...
...
@@ -69,17 +69,17 @@ macro(_find_python PYTHON_ROOT VERSION)
endmacro
()
macro
(
_find_python_bin PYTHON_ROOT VERSION
)
string
(
REPLACE
"."
""
_VERSION_NO_DOTS
${
VERSION
}
)
string
(
REPLACE
"."
""
_VERSION_NO_DOTS
"
${
VERSION
}
"
)
if
(
PYTHON_ROOT
)
find_program
(
PYTHON_BINARY
NAMES
"python"
"python
${
_VERSION_NO_DOTS
}
"
"python
${
VERSION
}
"
NAMES
"python
${
_VERSION_NO_DOTS
}
"
"python
${
VERSION
}
"
python.exe
HINTS
"
${
PYTHON_ROOT
}
"
PATH_SUFFIXES bin
NO_SYSTEM_ENVIRONMENT_PATH NO_DEFAULT_PATH
)
else
()
find_program
(
PYTHON_BINARY
NAMES
"python"
"python
${
_VERSION_NO_DOTS
}
"
"python
${
VERSION
}
"
NAMES
"python
${
_VERSION_NO_DOTS
}
"
"python
${
VERSION
}
"
HINTS
"
${
CMAKE_PREFIX_PATH
}
"
PATH_SUFFIXES bin
)
...
...
@@ -96,7 +96,8 @@ macro(check_for_python_lib)
_find_python
(
"
${
PYTHON_ROOT
}
"
"
${
PYTHON_VERSION
}
"
)
else
()
foreach
(
_VERSION
${
PYTHON_VERSIONS
}
)
if
(
${
PYTHON_MIN_VERSION
}
VERSION_LESS
${
_VERSION
}
)
if
((
${
PYTHON_MIN_VERSION
}
VERSION_LESS
${
_VERSION
}
)
OR
(
${
PYTHON_MIN_VERSION
}
VERSION_EQUAL
${
_VERSION
}
))
_find_python
(
"
${
PYTHON_ROOT
}
"
"
${
_VERSION
}
"
)
if
(
PYTHON_LIBRARIES
)
set
(
PYTHON_VERSION
"
${
_VERSION
}
"
)
...
...
@@ -105,6 +106,10 @@ macro(check_for_python_lib)
endif
()
endforeach
()
endif
()
# fallback to non-versioned naming scheme
if
(
NOT $PYTHON_LIBRARIES
)
_find_python
(
"
${
PYTHON_ROOT
}
"
""
)
endif
()
endmacro
()
macro
(
check_for_python_binary
)
...
...
@@ -112,15 +117,22 @@ macro(check_for_python_binary)
_find_python_bin
(
"
${
PYTHON_ROOT
}
"
"
${
PYTHON_VERSION
}
"
)
else
()
foreach
(
_VERSION
${
PYTHON_VERSIONS
}
)
if
(
${
PYTHON_MIN_VERSION
}
VERSION_LESS
${
_VERSION
}
)
if
((
${
PYTHON_MIN_VERSION
}
VERSION_LESS
${
_VERSION
}
)
OR
(
${
PYTHON_MIN_VERSION
}
VERSION_EQUAL
${
_VERSION
}
))
_find_python_bin
(
"
${
PYTHON_ROOT
}
"
"
${
_VERSION
}
"
)
if
(
PYTHON_
LIBRARIES
)
if
(
PYTHON_
BINARY
)
set
(
PYTHON_VERSION
"
${
_VERSION
}
"
)
# disallow all versions except for the one we just found. This makes
# sure we don't mismatch the python binary and the libraries.
set
(
PYTHON_VERSIONS
"
${
_VERSION
}
"
)
break
()
endif
()
endif
()
endforeach
()
endif
()
if
(
NOT PYTHON_BINARY
)
_find_python
(
"
${
PYTHON_ROOT
}
"
""
)
endif
()
endmacro
()
if
(
NOT PYTHON_ROOT
)
...
...
@@ -134,11 +146,13 @@ if(APPLE AND NOT PYTHON_IGNORE_FRAMEWORKS)
check_for_python_framework
()
endif
()
# first check for python binary.
check_for_python_binary
()
if
(
NOT PYTHON_FRAMEWORK_FOUND
)
check_for_python_lib
()
endif
()
check_for_python_binary
()
mark_as_advanced
(
PYTHON_LIBRARIES
PYTHON_INCLUDE_PATH
...
...
@@ -159,6 +173,8 @@ if(PYTHON_LIBRARIES)
endif
()
if
(
PYTHON_BINARY
)
set
(
PYTHON_VERSION
"
${
PYTHON_VERSION
}
"
CACHE STRING
"Python Version"
FORCE
)
set
(
PYTHON_BINARY
"
${
PYTHON_BINARY
}
"
CACHE FILEPATH
"Python Binary"
FORCE
)
endif
()
This diff is collapsed.
Click to expand it.
cmake_support/PROMOD.cmake
0 → 100644
+
868
−
0
View file @
b698f491
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