Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yaml-cpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
yaml-cpp
Commits
ab5f9259
Commit
ab5f9259
authored
May 05, 2018
by
Patrick Stotko
Committed by
Jesse Beder
May 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use target-based include_directories to enable modern CMake usage (#583)
parent
124ae476
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
CMakeLists.txt
+12
-3
test/CMakeLists.txt
+1
-0
No files found.
CMakeLists.txt
View file @
ab5f9259
...
...
@@ -116,9 +116,10 @@ if(VERBOSE)
message
(
STATUS
"contrib_private_headers:
${
contrib_private_headers
}
"
)
endif
()
include_directories
(
${
YAML_CPP_SOURCE_DIR
}
/src
)
include_directories
(
${
YAML_CPP_SOURCE_DIR
}
/include
)
if
(
CMAKE_VERSION VERSION_LESS 2.8.12
)
include_directories
(
${
YAML_CPP_SOURCE_DIR
}
/src
)
include_directories
(
${
YAML_CPP_SOURCE_DIR
}
/include
)
endif
()
###
...
...
@@ -275,6 +276,14 @@ set(_INSTALL_DESTINATIONS
### Library
###
add_library
(
yaml-cpp
${
library_sources
}
)
if
(
NOT CMAKE_VERSION VERSION_LESS 2.8.12
)
target_include_directories
(
yaml-cpp
PUBLIC $<BUILD_INTERFACE:
${
YAML_CPP_SOURCE_DIR
}
/include>
$<INSTALL_INTERFACE:
${
INCLUDE_INSTALL_ROOT_DIR
}
>
PRIVATE $<BUILD_INTERFACE:
${
YAML_CPP_SOURCE_DIR
}
/src>
)
endif
()
set_target_properties
(
yaml-cpp PROPERTIES
COMPILE_FLAGS
"
${
yaml_c_flags
}
${
yaml_cxx_flags
}
"
)
...
...
test/CMakeLists.txt
View file @
ab5f9259
...
...
@@ -30,6 +30,7 @@ file(GLOB test_new_api_sources new-api/[a-z]*.cpp)
list
(
APPEND test_sources
${
test_new_api_sources
}
)
add_sources
(
${
test_sources
}
${
test_headers
}
)
include_directories
(
${
YAML_CPP_SOURCE_DIR
}
/src
)
include_directories
(
${
YAML_CPP_SOURCE_DIR
}
/test
)
add_executable
(
run-tests
...
...
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