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
06a1f4d0
Unverified
Commit
06a1f4d0
authored
Apr 18, 2021
by
Andrea Pappacoda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use GTest imported target in tests/CMakelists.txt
parent
c065b648
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
CMakeLists.txt
CMakeLists.txt
+0
-2
tests/CMakeLists.txt
tests/CMakeLists.txt
+7
-2
No files found.
CMakeLists.txt
View file @
06a1f4d0
...
@@ -102,8 +102,6 @@ if (PISTACHE_BUILD_TESTS)
...
@@ -102,8 +102,6 @@ if (PISTACHE_BUILD_TESTS)
add_subdirectory
(
${
googletest_SOURCE_DIR
}
${
googletest_BINARY_DIR
}
)
add_subdirectory
(
${
googletest_SOURCE_DIR
}
${
googletest_BINARY_DIR
}
)
endif
()
endif
()
endif
()
endif
()
enable_testing
()
add_subdirectory
(
tests
)
add_subdirectory
(
tests
)
endif
()
endif
()
...
...
tests/CMakeLists.txt
View file @
06a1f4d0
...
@@ -5,8 +5,13 @@ function(pistache_test test_name)
...
@@ -5,8 +5,13 @@ function(pistache_test test_name)
set
(
TEST_SOURCE
${
test_name
}
.cc
)
set
(
TEST_SOURCE
${
test_name
}
.cc
)
add_executable
(
${
TEST_EXECUTABLE
}
${
TEST_SOURCE
}
)
add_executable
(
${
TEST_EXECUTABLE
}
${
TEST_SOURCE
}
)
target_include_directories
(
${
TEST_EXECUTABLE
}
PRIVATE
${
GTEST_INCLUDE_DIRS
}
${
CURL_INCLUDE_DIRS
}
)
target_include_directories
(
${
TEST_EXECUTABLE
}
PRIVATE
${
CURL_INCLUDE_DIRS
}
)
target_link_libraries
(
${
TEST_EXECUTABLE
}
gtest gtest_main pistache_static
${
CURL_LIBRARIES
}
)
# CMake 3.20 and upstream GTest define GTest::gtest, older versions define GTest::GTest
if
(
TARGET GTest::gtest
)
target_link_libraries
(
${
TEST_EXECUTABLE
}
GTest::gtest GTest::gtest_main pistache_static
${
CURL_LIBRARIES
}
)
else
()
target_link_libraries
(
${
TEST_EXECUTABLE
}
GTest::GTest GTest::Main pistache_static
${
CURL_LIBRARIES
}
)
endif
()
add_test
(
${
test_name
}
${
TEST_EXECUTABLE
}
)
add_test
(
${
test_name
}
${
TEST_EXECUTABLE
}
)
endfunction
()
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