-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Karol Szuster <[email protected]>
- Loading branch information
Showing
17 changed files
with
163 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,23 @@ | ||
include_guard(GLOBAL) | ||
|
||
# Building YAML | ||
include(ExternalProject) | ||
include(FetchContent) | ||
FetchContent_Declare( | ||
yaml-cpp-project | ||
GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git | ||
GIT_TAG yaml-cpp-0.6.3 | ||
GIT_SHALLOW ON | ||
) | ||
|
||
ExternalProject_Add(yaml-cpp-project | ||
GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git | ||
GIT_TAG yaml-cpp-0.6.3 | ||
GIT_SHALLOW ON | ||
GIT_PROGRESS ON | ||
SOURCE_DIR "${CMAKE_BINARY_DIR}/yaml-cpp-src" | ||
BINARY_DIR "${CMAKE_BINARY_DIR}/yaml-cpp-build" | ||
INSTALL_DIR "${CMAKE_BINARY_DIR}/install" | ||
CMAKE_ARGS | ||
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> | ||
-DCMAKE_CXX_EXTENSIONS=OFF | ||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} | ||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | ||
-DYAML_BUILD_SHARED_LIBS=${BUILD_DYNAMIC} | ||
-DYAML_MSVC_SHARED_RT=${BUILD_DYNAMIC} | ||
-DYAML_CPP_BUILD_CONTRIB=OFF | ||
-DYAML_CPP_BUILD_TESTS=OFF | ||
-DYAML_CPP_BUILD_TOOLS=OFF | ||
) | ||
set(YAML_CPP_BUILD_TESTS OFF CACHE INTERNAL "") | ||
set(YAML_CPP_BUILD_TOOLS OFF CACHE INTERNAL "") | ||
set(YAML_CPP_BUILD_CONTRIB OFF CACHE INTERNAL "") | ||
set(YAML_BUILD_SHARED_LIBS ${BUILD_DYNAMIC} CACHE INTERNAL "") | ||
set(YAML_MSVC_SHARED_RT ${BUILD_DYNAMIC} CACHE INTERNAL "") | ||
FetchContent_MakeAvailable(yaml-cpp-project) | ||
|
||
ExternalProject_Get_Property(yaml-cpp-project INSTALL_DIR) | ||
|
||
if (BUILD_DYNAMIC) | ||
add_library(yaml-cpp SHARED IMPORTED GLOBAL) | ||
set_target_properties(yaml-cpp | ||
PROPERTIES | ||
IMPORTED_LOCATION ${INSTALL_DIR}/bin/libyaml-cpp.dll | ||
IMPORTED_IMPLIB ${INSTALL_DIR}/lib/yaml-cpp.lib | ||
) | ||
else() | ||
add_library(yaml-cpp STATIC IMPORTED GLOBAL) | ||
set_target_properties(yaml-cpp PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/libyaml-cppmt.lib) | ||
endif() | ||
|
||
set(YAML_CPP_INCLUDE_DIR "${INSTALL_DIR}/include") | ||
set(YAML_CPP_INCLUDE_DIR "${yaml-cpp-project_SOURCE_DIR}/include") | ||
set(YAML_CPP_LIBRARIES "yaml-cpp") | ||
if (WIN32) | ||
target_compile_definitions(${YAML_CPP_LIBRARIES} PRIVATE /wd4251 /wd4275) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.