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
Show 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)
...
@@ -2,6 +2,10 @@ cmake_minimum_required (VERSION 3.0.2)
project
(
pistache
)
project
(
pistache
)
include
(
CheckCXXCompilerFlag
)
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++11"
COMPILER_SUPPORTS_CXX11
)
CHECK_CXX_COMPILER_FLAG
(
"-std=c++0x"
COMPILER_SUPPORTS_CXX0X
)
CHECK_CXX_COMPILER_FLAG
(
"-std=c++0x"
COMPILER_SUPPORTS_CXX0X
)
if
(
COMPILER_SUPPORTS_CXX11
)
if
(
COMPILER_SUPPORTS_CXX11
)
...
@@ -17,15 +21,19 @@ add_subdirectory (src)
...
@@ -17,15 +21,19 @@ add_subdirectory (src)
include_directories
(
src
)
include_directories
(
src
)
add_subdirectory
(
examples
)
if
(
PISTACHE_BUILD_EXAMPLES
)
add_subdirectory
(
examples
)
endif
()
find_package
(
GTest
)
if
(
PISTACHE_BUILD_TESTS
)
if
(
GTEST_FOUND
)
find_package
(
GTest
)
if
(
GTEST_FOUND
)
include_directories
(
${
GTEST_INCLUDE_DIRS
}
)
include_directories
(
${
GTEST_INCLUDE_DIRS
}
)
else
()
else
()
ADD_SUBDIRECTORY
(
googletest-release-1.7.0
)
ADD_SUBDIRECTORY
(
googletest-release-1.7.0
)
include_directories
(
${
gtest_SOURCE_DIR
}
/include
${
gtest_SOURCE_DIR
}
)
include_directories
(
${
gtest_SOURCE_DIR
}
/include
${
gtest_SOURCE_DIR
}
)
endif
()
endif
()
enable_testing
()
enable_testing
()
add_subdirectory
(
tests
)
add_subdirectory
(
tests
)
endif
()
src/CMakeLists.txt
View file @
08de0904
...
@@ -28,7 +28,8 @@ set(bin_install_dir "bin/")
...
@@ -28,7 +28,8 @@ set(bin_install_dir "bin/")
target_link_libraries
(
pistache pthread
)
target_link_libraries
(
pistache pthread
)
install
(
if
(
PISTACHE_INSTALL
)
install
(
TARGETS pistache
TARGETS pistache
EXPORT
${
targets_export_name
}
EXPORT
${
targets_export_name
}
ARCHIVE DESTINATION
${
lib_install_dir
}
ARCHIVE DESTINATION
${
lib_install_dir
}
...
@@ -36,27 +37,28 @@ install(
...
@@ -36,27 +37,28 @@ install(
RUNTIME DESTINATION
${
bin_install_dir
}
RUNTIME DESTINATION
${
bin_install_dir
}
INCLUDES DESTINATION
${
include_install_dir
}
)
INCLUDES DESTINATION
${
include_install_dir
}
)
install
(
install
(
DIRECTORY
"
${
PROJECT_SOURCE_DIR
}
/include/pistache"
DIRECTORY
"
${
PROJECT_SOURCE_DIR
}
/include/pistache"
DESTINATION
${
include_install_dir
}
DESTINATION
${
include_install_dir
}
FILES_MATCHING PATTERN
"*.*h"
)
FILES_MATCHING PATTERN
"*.*h"
)
install
(
TARGETS pistache
install
(
TARGETS pistache
EXPORT PistacheTargets
EXPORT PistacheTargets
DESTINATION lib
)
DESTINATION lib
)
install
(
EXPORT PistacheTargets
install
(
EXPORT PistacheTargets
DESTINATION
"lib/cmake/pistache"
DESTINATION
"lib/cmake/pistache"
EXPORT_LINK_INTERFACE_LIBRARIES
EXPORT_LINK_INTERFACE_LIBRARIES
COMPONENT cmake-config
COMPONENT cmake-config
)
)
include
(
CMakePackageConfigHelpers
)
include
(
CMakePackageConfigHelpers
)
configure_package_config_file
(
configure_package_config_file
(
"PistacheConfig.cmake.in"
"PistacheConfig.cmake.in"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/PistacheConfig.cmake"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/PistacheConfig.cmake"
INSTALL_DESTINATION
"lib/cmake/pistache"
INSTALL_DESTINATION
"lib/cmake/pistache"
)
)
install
(
install
(
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/PistacheConfig.cmake"
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/PistacheConfig.cmake"
DESTINATION
"lib/cmake/pistache"
DESTINATION
"lib/cmake/pistache"
COMPONENT cmake-config
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