2017-02-09 20:07:37 +01:00
|
|
|
add_executable(fgrcc fgrcc.cxx fgrcc.hxx)
|
2020-08-19 14:49:50 +01:00
|
|
|
target_link_libraries(fgrcc SimGearCore)
|
2019-12-26 01:26:44 -06:00
|
|
|
|
2020-01-11 20:22:46 +01:00
|
|
|
# On Windows, make sure fgrcc can be run (it needs third-party libraries) in add_custom_target
|
|
|
|
if(MSVC)
|
|
|
|
set_target_properties(fgrcc PROPERTIES DEBUG_POSTFIX d)
|
2020-08-26 13:57:24 +01:00
|
|
|
if (FINAL_MSVC_3RDPARTY_DIR)
|
|
|
|
set(CMAKE_MSVCIDE_RUN_PATH ${FINAL_MSVC_3RDPARTY_DIR}/bin)
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "FINAL_MSVC_3RDPARTY_DIR is empty or unset")
|
|
|
|
endif()
|
2020-01-11 20:22:46 +01:00
|
|
|
endif()
|
|
|
|
|
2020-08-21 12:13:10 +01:00
|
|
|
add_custom_command(
|
2019-12-26 01:26:44 -06:00
|
|
|
COMMAND
|
|
|
|
fgrcc --root=${CMAKE_SOURCE_DIR}
|
|
|
|
--output-cpp-file=${CMAKE_BINARY_DIR}/src/EmbeddedResources/FlightGear-resources.cxx
|
|
|
|
--init-func-name=initFlightGearEmbeddedResources
|
|
|
|
--output-header-file=${CMAKE_BINARY_DIR}/src/EmbeddedResources/FlightGear-resources.hxx
|
|
|
|
--output-header-identifier=_FG_FLIGHTGEAR_EMBEDDED_RESOURCES
|
|
|
|
${CMAKE_SOURCE_DIR}/src/EmbeddedResources/FlightGear-resources.xml
|
2020-08-21 12:13:10 +01:00
|
|
|
OUTPUT
|
2019-12-26 01:26:44 -06:00
|
|
|
${CMAKE_BINARY_DIR}/src/EmbeddedResources/FlightGear-resources.cxx
|
|
|
|
${CMAKE_BINARY_DIR}/src/EmbeddedResources/FlightGear-resources.hxx
|
2020-08-21 12:13:10 +01:00
|
|
|
MAIN_DEPENDENCY
|
2019-12-26 01:26:44 -06:00
|
|
|
fgrcc ${CMAKE_SOURCE_DIR}/src/EmbeddedResources/FlightGear-resources.xml
|
2020-08-21 12:13:10 +01:00
|
|
|
COMMENT
|
|
|
|
"Re-generating embedded resources"
|
2019-12-26 01:26:44 -06:00
|
|
|
)
|
2020-08-21 12:13:10 +01:00
|
|
|
|
|
|
|
# set automatically by add_custom_command?
|
|
|
|
#set_source_files_properties(${EMBEDDED_RESOURCE_SOURCES} PROPERTIES GENERATED TRUE)
|
|
|
|
#set_source_files_properties(${EMBEDDED_RESOURCE_HEADERS} PROPERTIES GENERATED TRUE)
|
|
|
|
|
2020-08-24 13:19:57 +01:00
|
|
|
add_library(fgembeddedresources STATIC
|
2020-08-21 12:13:10 +01:00
|
|
|
${CMAKE_BINARY_DIR}/src/EmbeddedResources/FlightGear-resources.cxx
|
2021-03-10 10:17:15 +00:00
|
|
|
${CMAKE_BINARY_DIR}/src/EmbeddedResources/FlightGear-resources.hxx
|
|
|
|
)
|
|
|
|
|
|
|
|
# users of the library include this as <EmbeddedResources/FlightGear-resources.hxx>
|
|
|
|
target_include_directories(fgembeddedresources INTERFACE ${CMAKE_BINARY_DIR}/src)
|
2020-08-21 12:13:10 +01:00
|
|
|
|
|
|
|
target_link_libraries(fgembeddedresources SimGearCore)
|
|
|
|
|
|
|
|
# don't try to Automoc these files, it confuses the dependency logic
|
|
|
|
set_property(TARGET fgembeddedresources PROPERTY AUTOMOC OFF)
|
|
|
|
|