Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
44d7c59c
Commit
44d7c59c
authored
Dec 13, 2016
by
Lori A. Burns
Committed by
Wenzel Jakob
Dec 13, 2016
Browse files
make installation include and Config dirs configurable. set CMake project version from source.
parent
76e993a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
CMakeLists.txt
CMakeLists.txt
+17
-1
No files found.
CMakeLists.txt
View file @
44d7c59c
...
...
@@ -179,6 +179,22 @@ if (PYBIND11_TEST)
add_subdirectory
(
tests
)
endif
()
include
(
GNUInstallDirs
)
# extract project version from source
file
(
STRINGS
"
${
PYBIND11_INCLUDE_DIR
}
/pybind11/common.h"
pybind11_version_defines
REGEX
"#define PYBIND11_VERSION_(MAJOR|MINOR|PATCH) "
)
foreach
(
ver
${
pybind11_version_defines
}
)
if
(
ver MATCHES
"#define PYBIND11_VERSION_(MAJOR|MINOR|PATCH) +([^ ]+)$"
)
set
(
PYBIND11_VERSION_
${
CMAKE_MATCH_1
}
"
${
CMAKE_MATCH_2
}
"
CACHE INTERNAL
""
)
endif
()
endforeach
()
set
(
${
PROJECT_NAME
}
_VERSION
${
PYBIND11_VERSION_MAJOR
}
.
${
PYBIND11_VERSION_MINOR
}
.
${
PYBIND11_VERSION_PATCH
}
)
if
(
PYBIND11_INSTALL
)
install
(
FILES
${
PYBIND11_HEADERS
}
DESTINATION include/pybind11
)
install
(
FILES
${
PYBIND11_HEADERS
}
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
/pybind11
)
# GNUInstallDirs "DATADIR" wrong here; CMake search path wants "share".
set
(
PYBIND11_CMAKECONFIG_INSTALL_DIR
"share/cmake/
${
PROJECT_NAME
}
"
CACHE STRING
"install path for pybind11Config.cmake"
)
endif
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment