From 026b02d7e97371b23d19f1b01ed03f3a9ef935db Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 10 Mar 2021 10:17:15 +0000 Subject: [PATCH] CMake: make another object dependency explicit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since we’re not using target_link_libraries, we need to explicitly define fgfsObjects (which contains main.cxx) as depending on the embedded resources target. --- CMakeLists.txt | 2 ++ src/EmbeddedResources/CMakeLists.txt | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 43d533193..c6182fbdd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -495,6 +495,8 @@ include(SetupFGFSLibraries) add_library(fgfsObjects OBJECT flightgear-version) add_dependencies(fgfsObjects buildId) +# remove once we use CMake 3.12, since then the dependency will be explicit +add_dependencies(fgfsObjects fgembeddedresources) ######################################################################## diff --git a/src/EmbeddedResources/CMakeLists.txt b/src/EmbeddedResources/CMakeLists.txt index 41428edb6..140422c7d 100644 --- a/src/EmbeddedResources/CMakeLists.txt +++ b/src/EmbeddedResources/CMakeLists.txt @@ -34,7 +34,11 @@ add_custom_command( add_library(fgembeddedresources STATIC ${CMAKE_BINARY_DIR}/src/EmbeddedResources/FlightGear-resources.cxx - ${CMAKE_BINARY_DIR}/src/EmbeddedResources/FlightGear-resources.hxx) + ${CMAKE_BINARY_DIR}/src/EmbeddedResources/FlightGear-resources.hxx + ) + +# users of the library include this as +target_include_directories(fgembeddedresources INTERFACE ${CMAKE_BINARY_DIR}/src) target_link_libraries(fgembeddedresources SimGearCore)