Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
yaml-cpp
Commits
9a72702a
Commit
9a72702a
authored
Mar 16, 2011
by
Jesse Beder
Browse files
Added option to disable compilation of contrib code
parent
ebdfeb03
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
+22
-5
CMakeLists.txt
CMakeLists.txt
+22
-5
No files found.
CMakeLists.txt
View file @
9a72702a
...
...
@@ -33,7 +33,8 @@ enable_testing()
### Project options
###
## Project stuff
option
(
YAML_CPP_BUILD_TOOLS
"Enable testing and parse tools"
ON
)
option
(
YAML_CPP_BUILD_TOOLS
"Enable testing and parse tools"
ON
)
option
(
YAML_CPP_BUILD_CONTRIB
"Enable contrib stuff in library"
ON
)
## Build options
# --> General
...
...
@@ -54,14 +55,25 @@ option(MSVC_STHREADED_RT "MSVC: Build with single-threaded static runtime libs (
###
### Sources, headers, directories and libs
###
file
(
GLOB_RECURSE sources
"src/[a-zA-Z]*.cpp"
)
file
(
GLOB_RECURSE public_headers
"include/yaml-cpp/[a-zA-Z]*.h"
)
file
(
GLOB_RECURSE private_headers
"src/[a-zA-Z]*.h"
)
file
(
GLOB sources
"src/[a-zA-Z]*.cpp"
)
file
(
GLOB public_headers
"include/yaml-cpp/[a-zA-Z]*.h"
)
file
(
GLOB private_headers
"src/[a-zA-Z]*.h"
)
if
(
YAML_CPP_BUILD_CONTRIB
)
file
(
GLOB contrib_sources
"src/contrib/[a-zA-Z]*.cpp"
)
file
(
GLOB contrib_public_headers
"include/yaml-cpp/contrib/[a-zA-Z]*.h"
)
file
(
GLOB contrib_private_headers
"src/contrib/[a-zA-Z]*.h"
)
else
()
add_definitions
(
-DYAML_CPP_NO_CONTRIB
)
endif
()
if
(
VERBOSE
)
message
(
STATUS
"sources:
${
sources
}
"
)
message
(
STATUS
"public_headers:
${
public_headers
}
"
)
message
(
STATUS
"private_headers:
${
private_headers
}
"
)
message
(
STATUS
"contrib_sources:
${
contrib_sources
}
"
)
message
(
STATUS
"contrib_public_headers:
${
contrib_public_headers
}
"
)
message
(
STATUS
"contrib_private_headers:
${
contrib_private_headers
}
"
)
endif
()
include_directories
(
${
YAML_CPP_SOURCE_DIR
}
/include
)
...
...
@@ -214,6 +226,9 @@ add_library(yaml-cpp
${
sources
}
${
public_headers
}
${
private_headers
}
${
contrib_sources
}
${
contrib_public_headers
}
${
contrib_private_headers
}
)
set_target_properties
(
yaml-cpp PROPERTIES
...
...
@@ -242,7 +257,9 @@ endif()
install
(
TARGETS yaml-cpp
${
_INSTALL_DESTINATIONS
}
)
install
(
FILES
${
public_headers
}
FILES
${
public_headers
}
${
contrib_public_headers
}
DESTINATION
${
INCLUDE_INSTALL_DIR
}
)
...
...
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