Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
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
openstructure
Commits
6ad8103a
Commit
6ad8103a
authored
5 years ago
by
Gerardo Tauriello
Browse files
Options
Downloads
Patches
Plain Diff
Enable different namings of Boost Python library.
parent
93e1e866
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+7
-1
7 additions, 1 deletion
CMakeLists.txt
cmake_support/OST.cmake
+23
-3
23 additions, 3 deletions
cmake_support/OST.cmake
with
30 additions
and
4 deletions
CMakeLists.txt
+
7
−
1
View file @
6ad8103a
...
...
@@ -188,6 +188,13 @@ if (ENABLE_STATIC AND UNIX AND NOT APPLE)
set
(
CMAKE_FIND_LIBRARY_SUFFIXES .a
)
endif
()
# Python needed before Boost
find_package
(
Python 2.4 REQUIRED
)
# Split version string
string
(
REPLACE
"."
";"
_python_version_list
${
PYTHON_VERSION
}
)
list
(
GET _python_version_list 0 PYTHON_VERSION_MAJOR
)
list
(
GET _python_version_list 1 PYTHON_VERSION_MINOR
)
if
(
BOOST_VERSION
)
message
(
STATUS
"forcing boost to version
${
BOOST_VERSION
}
"
)
set
(
_BOOST_MIN_VERSION
${
BOOST_VERSION
}
)
...
...
@@ -233,7 +240,6 @@ else()
endif
()
find_package
(
Eigen 3.2.0 REQUIRED
)
find_package
(
Python 2.4 REQUIRED
)
find_package
(
SQLite3 3.7.13 REQUIRED
)
if
(
USE_NUMPY
)
...
...
This diff is collapsed.
Click to expand it.
cmake_support/OST.cmake
+
23
−
3
View file @
6ad8103a
...
...
@@ -770,7 +770,7 @@ macro(ost_match_boost_python_version)
# this variable may either be a simple library path or list that contains
# different libraries for different build-options. For example:
# optimized;<lib1>;debug;<lib2>
set
(
_BOOST_PYTHON_LIBRARY
${
B
oost
_PYTHON_LIBRAR
Y
}
)
set
(
_BOOST_PYTHON_LIBRARY
${
B
OOST
_PYTHON_LIBRAR
IES
}
)
list
(
LENGTH _BOOST_PYTHON_LIBRARY _BP_LENGTH
)
if
(
_BP_LENGTH GREATER 1
)
list
(
FIND _BOOST_PYTHON_LIBRARY optimized _OPTIMIZED_INDEX
)
...
...
@@ -902,8 +902,28 @@ set(_BOOST_MIN_VERSION 1.31)
macro
(
setup_boost
)
set
(
Boost_NO_BOOST_CMAKE TRUE
)
find_package
(
Boost
${
_BOOST_MIN_VERSION
}
COMPONENTS python REQUIRED
)
set
(
BOOST_PYTHON_LIBRARIES
${
Boost_LIBRARIES
}
)
# starting with CMake 3.11 we could use the following instead of the foreach
# find_package(Boost ${_BOOST_MIN_VERSION} COMPONENTS
# python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR} REQUIRED)
# set(BOOST_PYTHON_LIBRARIES ${Boost_LIBRARIES})
# see https://cmake.org/cmake/help/v3.11/module/FindBoost.html
foreach
(
_python_lib_name python
python
${
PYTHON_VERSION_MAJOR
}${
PYTHON_VERSION_MINOR
}
python
${
PYTHON_VERSION_MAJOR
}
.
${
PYTHON_VERSION_MINOR
}
python
${
PYTHON_VERSION_MAJOR
}
)
find_package
(
Boost
${
_BOOST_MIN_VERSION
}
COMPONENTS
${
_python_lib_name
}
QUIET
)
if
(
Boost_FOUND
)
message
(
STATUS
"Found Boost package: "
${
_python_lib_name
}
)
set
(
BOOST_PYTHON_LIBRARIES
${
Boost_LIBRARIES
}
)
break
()
else
()
message
(
STATUS
"Boost package not found: "
${
_python_lib_name
}
". Trying alternative names!"
)
endif
()
endforeach
(
_python_lib_name
)
if
(
NOT BOOST_PYTHON_LIBRARIES
)
message
(
FATAL_ERROR
"Failed to find any Boost Python library!"
)
endif
()
set
(
Boost_LIBRARIES
)
find_package
(
Boost
${
_BOOST_MIN_VERSION
}
COMPONENTS unit_test_framework 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