From a013791e2c688584d7ab2d916cec6458b0016b03 Mon Sep 17 00:00:00 2001 From: Roger Hu Date: Wed, 29 May 2019 00:25:42 -0700 Subject: [PATCH 1/2] Use subprojects instead --- lib/CMakeLists.txt | 6 ++++-- test/CMakeLists.txt | 2 ++ tool/CMakeLists.txt | 7 ++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index cf9f392..3ea2bbf 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,3 +1,5 @@ +project(lib) + include(CheckLibraryExists) # LibXml2 Dependency @@ -41,8 +43,8 @@ endif() # Configure header configure_file ( - "${PROJECT_SOURCE_DIR}/lib/include/ebc/Config.h.in" - "${PROJECT_BINARY_DIR}/ebc/Config.h") + "${lib_SOURCE_DIR}/include/ebc/Config.h.in" + "${lib_BINARY_DIR}/ebc/Config.h") # UUID if(UNIX AND NOT APPLE) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e629b4b..1193f1a 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,3 +1,5 @@ +project (test) + # LibXml2 Dependency find_package(LibXml2 REQUIRED) include_directories(${LIBXML2_INCLUDE_DIR}) diff --git a/tool/CMakeLists.txt b/tool/CMakeLists.txt index 4248595..6eea744 100644 --- a/tool/CMakeLists.txt +++ b/tool/CMakeLists.txt @@ -1,11 +1,12 @@ +project (tool) add_subdirectory(vendor) # Configure configure_file ( - "${PROJECT_SOURCE_DIR}/tool/ebcutil.cpp" - "${PROJECT_BINARY_DIR}/tool/ebcutil.cpp") + "${tool_SOURCE_DIR}/ebcutil.cpp" + "${tool_BINARY_DIR}/ebcutil.cpp") -add_executable(ebcutil ${PROJECT_BINARY_DIR}/tool/ebcutil.cpp) +add_executable(ebcutil ${tool_BINARY_DIR}/ebcutil.cpp) target_link_libraries(ebcutil ebc tclap rang) set_property(TARGET ebcutil PROPERTY CXX_STANDARD 14) From fbadd34c1a491909013ff2e57034fc773ce50cb3 Mon Sep 17 00:00:00 2001 From: Roger Hu Date: Wed, 29 May 2019 00:31:44 -0700 Subject: [PATCH 2/2] Update to CMake 3.5 min --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6aac3c7..6f33975 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.5 FATAL_ERROR) project (LibEBC)