Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pistache
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
pistache
Commits
08de0904
Unverified
Commit
08de0904
authored
Feb 20, 2018
by
Mathieu Stefani
Committed by
GitHub
Feb 20, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #192 from tropf/master
make more friendly to embed in cmake projects
parents
4bfc4f81
197123b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
40 deletions
+50
-40
CMakeLists.txt
CMakeLists.txt
+18
-10
src/CMakeLists.txt
src/CMakeLists.txt
+32
-30
No files found.
CMakeLists.txt
View file @
08de0904
...
...
@@ -2,6 +2,10 @@ cmake_minimum_required (VERSION 3.0.2)
project
(
pistache
)
include
(
CheckCXXCompilerFlag
)
option
(
PISTACHE_BUILD_TESTS
"build tests alongside the project"
OFF
)
option
(
PISTACHE_BUILD_EXAMPLES
"build examples alongside the project"
OFF
)
option
(
PISTACHE_INSTALL
"add pistache as install target (recommended)"
ON
)
CHECK_CXX_COMPILER_FLAG
(
"-std=c++11"
COMPILER_SUPPORTS_CXX11
)
CHECK_CXX_COMPILER_FLAG
(
"-std=c++0x"
COMPILER_SUPPORTS_CXX0X
)
if
(
COMPILER_SUPPORTS_CXX11
)
...
...
@@ -17,15 +21,19 @@ add_subdirectory (src)
include_directories
(
src
)
add_subdirectory
(
examples
)
find_package
(
GTest
)
if
(
GTEST_FOUND
)
include_directories
(
${
GTEST_INCLUDE_DIRS
}
)
else
()
ADD_SUBDIRECTORY
(
googletest-release-1.7.0
)
include_directories
(
${
gtest_SOURCE_DIR
}
/include
${
gtest_SOURCE_DIR
}
)
if
(
PISTACHE_BUILD_EXAMPLES
)
add_subdirectory
(
examples
)
endif
()
enable_testing
()
add_subdirectory
(
tests
)
if
(
PISTACHE_BUILD_TESTS
)
find_package
(
GTest
)
if
(
GTEST_FOUND
)
include_directories
(
${
GTEST_INCLUDE_DIRS
}
)
else
()
ADD_SUBDIRECTORY
(
googletest-release-1.7.0
)
include_directories
(
${
gtest_SOURCE_DIR
}
/include
${
gtest_SOURCE_DIR
}
)
endif
()
enable_testing
()
add_subdirectory
(
tests
)
endif
()
src/CMakeLists.txt
View file @
08de0904
...
...
@@ -28,35 +28,37 @@ set(bin_install_dir "bin/")
target_link_libraries
(
pistache pthread
)
install
(
TARGETS pistache
EXPORT
${
targets_export_name
}
ARCHIVE DESTINATION
${
lib_install_dir
}
LIBRARY DESTINATION
${
lib_install_dir
}
RUNTIME DESTINATION
${
bin_install_dir
}
INCLUDES DESTINATION
${
include_install_dir
}
)
install
(
DIRECTORY
"
${
PROJECT_SOURCE_DIR
}
/include/pistache"
DESTINATION
${
include_install_dir
}
FILES_MATCHING PATTERN
"*.*h"
)
install
(
TARGETS pistache
EXPORT PistacheTargets
DESTINATION lib
)
install
(
EXPORT PistacheTargets
if
(
PISTACHE_INSTALL
)
install
(
TARGETS pistache
EXPORT
${
targets_export_name
}
ARCHIVE DESTINATION
${
lib_install_dir
}
LIBRARY DESTINATION
${
lib_install_dir
}
RUNTIME DESTINATION
${
bin_install_dir
}
INCLUDES DESTINATION
${
include_install_dir
}
)
install
(
DIRECTORY
"
${
PROJECT_SOURCE_DIR
}
/include/pistache"
DESTINATION
${
include_install_dir
}
FILES_MATCHING PATTERN
"*.*h"
)
install
(
TARGETS pistache
EXPORT PistacheTargets
DESTINATION lib
)
install
(
EXPORT PistacheTargets
DESTINATION
"lib/cmake/pistache"
EXPORT_LINK_INTERFACE_LIBRARIES
COMPONENT cmake-config
)
include
(
CMakePackageConfigHelpers
)
configure_package_config_file
(
"PistacheConfig.cmake.in"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/PistacheConfig.cmake"
INSTALL_DESTINATION
"lib/cmake/pistache"
)
install
(
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/PistacheConfig.cmake"
DESTINATION
"lib/cmake/pistache"
EXPORT_LINK_INTERFACE_LIBRARIES
COMPONENT cmake-config
)
include
(
CMakePackageConfigHelpers
)
configure_package_config_file
(
"PistacheConfig.cmake.in"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/PistacheConfig.cmake"
INSTALL_DESTINATION
"lib/cmake/pistache"
)
install
(
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/PistacheConfig.cmake"
DESTINATION
"lib/cmake/pistache"
COMPONENT cmake-config
)
)
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