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
c5dd200a
Unverified
Commit
c5dd200a
authored
Jan 16, 2019
by
Dennis Jenkins
Committed by
GitHub
Jan 16, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #409 from hwaan2/change_cmake
Change Cmakefiles > Issue #357
parents
c5ff6f9a
b871e25f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
30 deletions
+43
-30
CMakeLists.txt
CMakeLists.txt
+24
-19
examples/CMakeLists.txt
examples/CMakeLists.txt
+1
-1
src/CMakeLists.txt
src/CMakeLists.txt
+17
-9
tests/CMakeLists.txt
tests/CMakeLists.txt
+1
-1
No files found.
CMakeLists.txt
View file @
c5dd200a
...
...
@@ -23,6 +23,12 @@ else()
# Following workaround forces Clang to compile at best with C++14
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"Clang"
)
set
(
CMAKE_CXX_STANDARD 14
)
elseif
(
CMAKE_COMPILER_IS_GNUCC
)
if
(
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0
)
set
(
CMAKE_CXX_STANDARD 17
)
else
()
set
(
CMAKE_CXX_STANDARD 14
)
endif
()
else
()
set
(
CMAKE_CXX_STANDARD 17
)
endif
()
...
...
@@ -31,25 +37,6 @@ else()
endif
()
include_directories
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/include
)
add_subdirectory
(
src
)
if
(
PISTACHE_BUILD_EXAMPLES
)
add_subdirectory
(
examples
)
endif
()
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
()
# Set version...
# Major and minor version...
...
...
@@ -110,3 +97,21 @@ if(PISTACHE_INSTALL)
)
endif
()
add_subdirectory
(
src
)
if
(
PISTACHE_BUILD_EXAMPLES
)
add_subdirectory
(
examples
)
endif
()
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
()
examples/CMakeLists.txt
View file @
c5dd200a
...
...
@@ -3,7 +3,7 @@ function(pistache_example example_name)
set
(
EXAMPLE_SOURCE
${
example_name
}
.cc
)
add_executable
(
${
EXAMPLE_EXECUTABLE
}
${
EXAMPLE_SOURCE
}
)
target_link_libraries
(
${
EXAMPLE_EXECUTABLE
}
pistache
)
target_link_libraries
(
${
EXAMPLE_EXECUTABLE
}
pistache
_static
)
endfunction
()
pistache_example
(
http_server
)
...
...
src/CMakeLists.txt
View file @
c5dd200a
...
...
@@ -11,12 +11,8 @@ set(SOURCE_FILES
${
INCLUDE_FILES
}
)
add_library
(
pistache
${
SOURCE_FILES
}
)
set_target_properties
(
pistache PROPERTIES
OUTPUT_NAME
"pistache"
VERSION
${
GENERIC_LIB_VERSION
}
SOVERSION
${
GENERIC_LIB_SOVERSION
}
)
add_library
(
pistache OBJECT
${
SOURCE_FILES
}
)
set_target_properties
(
pistache PROPERTIES POSITION_INDEPENDENT_CODE 1
)
add_definitions
(
-DONLY_C_LOCALE=1
)
target_include_directories
(
pistache PUBLIC
...
...
@@ -27,11 +23,23 @@ set(include_install_dir "include")
set
(
lib_install_dir
"lib/"
)
set
(
bin_install_dir
"bin/"
)
target_link_libraries
(
pistache pthread
)
add_library
(
pistache_shared SHARED $<TARGET_OBJECTS:pistache>
)
add_library
(
pistache_static STATIC $<TARGET_OBJECTS:pistache>
)
target_link_libraries
(
pistache_shared pthread
)
target_link_libraries
(
pistache_static pthread
)
set_target_properties
(
pistache_shared PROPERTIES
OUTPUT_NAME
"pistache"
VERSION
${
version
}
SOVERSION
${
VERSION_MAJOR
}
)
set_target_properties
(
pistache_static PROPERTIES OUTPUT_NAME
"pistache"
)
if
(
PISTACHE_INSTALL
)
install
(
TARGETS pistache
TARGETS pistache
_shared
EXPORT
${
targets_export_name
}
ARCHIVE DESTINATION
${
lib_install_dir
}
LIBRARY DESTINATION
${
lib_install_dir
}
...
...
@@ -42,7 +50,7 @@ if (PISTACHE_INSTALL)
DIRECTORY
"
${
PROJECT_SOURCE_DIR
}
/include/pistache"
DESTINATION
${
include_install_dir
}
FILES_MATCHING PATTERN
"*.*h"
)
install
(
TARGETS pistache
install
(
TARGETS pistache
_static
EXPORT PistacheTargets
DESTINATION lib
)
install
(
EXPORT PistacheTargets
...
...
tests/CMakeLists.txt
View file @
c5dd200a
...
...
@@ -3,7 +3,7 @@ function(pistache_test test_name)
set
(
TEST_SOURCE
${
test_name
}
.cc
)
add_executable
(
${
TEST_EXECUTABLE
}
${
TEST_SOURCE
}
)
target_link_libraries
(
${
TEST_EXECUTABLE
}
gtest gtest_main pistache curl pthread
)
target_link_libraries
(
${
TEST_EXECUTABLE
}
gtest gtest_main pistache
_static
curl pthread
)
add_test
(
${
test_name
}
${
TEST_EXECUTABLE
}
)
endfunction
()
...
...
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