Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
matplotlibcpp17
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HKHLR
matplotlibcpp17
Commits
62861231
Commit
62861231
authored
Mar 2, 2022
by
soblin
Browse files
Options
Downloads
Patches
Plain Diff
make install looks working
parent
811479c4
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+55
-7
55 additions, 7 deletions
CMakeLists.txt
cmake/matplotlibcpp17Config.cmake.in
+4
-0
4 additions, 0 deletions
cmake/matplotlibcpp17Config.cmake.in
with
59 additions
and
7 deletions
CMakeLists.txt
+
55
−
7
View file @
62861231
project
(
matplotlibcpp17
)
cmake_minimum_required
(
VERSION 3.12
)
project
(
"matplotlibcpp17"
VERSION 0.0.0
DESCRIPTION
"A C++ header-only plotting library based on pybind11 and matplotlib, featuring more flexibility than matplotlibcpp"
HOMEPAGE_URL
"https://soblin.github.io/matplotlibcpp17/"
)
find_package
(
Python3 COMPONENTS Interpreter Development NumPy
)
find_package
(
pybind11 REQUIRED
)
if
(
NOT DEFINED ADD_DEMO
)
set
(
ADD_DEMO ON
)
endif
()
set
(
matplotlibcpp17_INCLUDE_DIRS
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/include"
)
# gallery
if
(
NOT DEFINED USE_GUI
)
set
(
USE_GUI 0
)
endif
()
set
(
matplotlibcpp17_INCLUDE_DIRS
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/include"
)
if
(
NOT DEFINED ADD_DEMO
)
set
(
ADD_DEMO ON
)
endif
()
function
(
add_demo name path
)
add_executable
(
${
name
}
${
path
}
)
...
...
@@ -39,10 +45,52 @@ if(${ADD_DEMO})
add_subdirectory
(
gallery/mplot3d
)
endif
()
# test
if
(
NOT DEFINED DO_TEST
)
set
(
DO_TEST ON
)
endif
()
if
(
${
DO_TEST
}
)
add_subdirectory
(
tests
)
endif
()
# install
## https://dominikberner.ch/cmake-interface-lib/
include
(
GNUInstallDirs
)
add_library
(
${
PROJECT_NAME
}
INTERFACE
)
target_include_directories
(
${
PROJECT_NAME
}
INTERFACE
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/include>
$<INSTALL_INTERFACE:
${
CMAKE_INSTALL_INCLUDEDIR
}
>
)
target_compile_features
(
${
PROJECT_NAME
}
INTERFACE cxx_std_17
)
install
(
TARGETS
${
PROJECT_NAME
}
EXPORT
${
PROJECT_NAME
}
_Targets
ARCHIVE DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
LIBRARY DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
)
include
(
CMakePackageConfigHelpers
)
write_basic_package_version_file
(
"
${
PROJECT_NAME
}
ConfigVersion.cmake"
VERSION
${
PROJECT_VERSION
}
COMPATIBILITY SameMajorVersion
)
configure_package_config_file
(
"
${
PROJECT_SOURCE_DIR
}
/cmake/
${
PROJECT_NAME
}
Config.cmake.in"
"
${
PROJECT_BINARY_DIR
}
/
${
PROJECT_NAME
}
Config.cmake"
INSTALL_DESTINATION
${
CMAKE_INSTALL_DATAROOTDIR
}
/
${
PROJECT_NAME
}
/cmake
)
install
(
EXPORT
${
PROJECT_NAME
}
_Targets
FILE
${
PROJECT_NAME
}
Targets.cmake
NAMESPACE
${
PROJECT_NAME
}
::
DESTINATION
${
CMAKE_INSTALL_DATAROOTDIR
}
/
${
PROJECT_NAME
}
/cmake
)
install
(
FILES
"
${
PROJECT_BINARY_DIR
}
/
${
PROJECT_NAME
}
Config.cmake"
"
${
PROJECT_BINARY_DIR
}
/
${
PROJECT_NAME
}
ConfigVersion.cmake"
DESTINATION
${
CMAKE_INSTALL_DATAROOTDIR
}
/cmake
)
install
(
DIRECTORY
${
PROJECT_SOURCE_DIR
}
/include/
${
PROJECT_NAME
}
DESTINATION include
)
This diff is collapsed.
Click to expand it.
cmake/matplotlibcpp17Config.cmake.in
0 → 100644
+
4
−
0
View file @
62861231
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
check_required_components("@PROJECT_NAME@")
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