Reworks CMake wiring for Qt6 codegen include order
Adds missing toolchain packages and include dirs so generated headers resolve.
This commit is contained in:
25 files changed
+388
-84
No files matched your search
+21
-17
@@ -7,7 +7,7 @@
|
||||
|
||||
# Make ${Qt6_Gui} optional
|
||||
if(QT6_GUI_AVAILABLE AND TARGET Qt6::Gui)
|
||||
set(Qt6_Gui ${Qt6_Gui})
|
||||
set(Qt6_Gui Qt6::Gui)
|
||||
else()
|
||||
set(Qt6_Gui "")
|
||||
endif()
|
||||
@@ -32,6 +32,10 @@ SET(SRCS_common
|
||||
# Generate ism_enums.idl / ism.idl
|
||||
IF(BUILD_RTI)
|
||||
CODEGEN_IDL_SVC(SRCS_common ${xml_FILE})
|
||||
# The enums stub copy below would overwrite the rtiddsgen-generated
|
||||
# <svc>_enums.hpp (RTIDDSGEN on <svc>_enums.idl writes the same build-dir
|
||||
# path) on every cmake re-configure. Only keep it for BUILD_RTI=OFF.
|
||||
IF(NOT BUILD_RTI)
|
||||
# Stub file for compilation (fallback when no IDL exists)
|
||||
CONFIGURE_FILE(
|
||||
${CMAKE_SOURCE_DIR}/include/InfrastructureManagement/ism_enums.hpp.stub
|
||||
@@ -39,10 +43,15 @@ CONFIGURE_FILE(
|
||||
COPYONLY
|
||||
)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
# Generate ism_db_impl.cpp/.h, ism_db.h
|
||||
IF(BUILD_RTI)
|
||||
CODEGEN_DATABASE(SRCS_common ${xml_FILE})
|
||||
ENDIF()
|
||||
# The enums stub copy below would overwrite the rtiddsgen-generated
|
||||
# <svc>_enums.hpp (RTIDDSGEN on <svc>_enums.idl writes the same build-dir
|
||||
# path) on every cmake re-configure. Only keep it for BUILD_RTI=OFF.
|
||||
IF(NOT BUILD_RTI)
|
||||
# Copy ism_enums.hpp.stub to build directory for compilation
|
||||
CONFIGURE_FILE(
|
||||
${CMAKE_SOURCE_DIR}/include/InfrastructureManagement/ism_enums.hpp.stub
|
||||
@@ -51,11 +60,16 @@ CONFIGURE_FILE(
|
||||
)
|
||||
|
||||
|
||||
ENDIF()
|
||||
# Generate *.cpp/*.hpp from idl
|
||||
IF(BUILD_RTI)
|
||||
RTIDDSGEN(SRCS_common ism_enums.idl)
|
||||
RTIDDSGEN(SRCS_common ism.idl)
|
||||
ENDIF()
|
||||
# The enums stub copy below would overwrite the rtiddsgen-generated
|
||||
# <svc>_enums.hpp (RTIDDSGEN on <svc>_enums.idl writes the same build-dir
|
||||
# path) on every cmake re-configure. Only keep it for BUILD_RTI=OFF.
|
||||
IF(NOT BUILD_RTI)
|
||||
# Copy ism_enums.hpp.stub to build directory for compilation
|
||||
CONFIGURE_FILE(
|
||||
${CMAKE_SOURCE_DIR}/include/InfrastructureManagement/ism_enums.hpp.stub
|
||||
@@ -64,21 +78,17 @@ CONFIGURE_FILE(
|
||||
)
|
||||
|
||||
|
||||
ENDIF()
|
||||
# Generate ism_dt[s,c]_types.h, ism_ft[s,c]_types.h
|
||||
IF(BUILD_RTI)
|
||||
CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
|
||||
ENDIF()
|
||||
# Generate ism_[d|f]tc.h
|
||||
# The former BUILD_GRANTLEE=OFF fallback copied handwritten ism_dtc.h /
|
||||
# ism_ftc.h onto the CODEGEN_CLIENT_TOPICS_IFC output paths; those fake
|
||||
# generated files were removed (the qt5 legacy has no such source files).
|
||||
IF(BUILD_GRANTLEE)
|
||||
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
|
||||
ELSEIF(BUILD_RTI)
|
||||
# Use pre-generated files when BUILD_GRANTLEE=OFF
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/ism_dtc.h ${CMAKE_CURRENT_BINARY_DIR}/ism_dtc.h COPYONLY)
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/ism_ftc.h ${CMAKE_CURRENT_BINARY_DIR}/ism_ftc.h COPYONLY)
|
||||
LIST(APPEND SRCS_common
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ism_dtc.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ism_ftc.h
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
NGL_ADD_LIBRARY(AAR SV WS HLA svcIsmCommon SHARED ${SRCS_common})
|
||||
@@ -111,16 +121,10 @@ SET(SRCS_client
|
||||
parse_building_xml.h
|
||||
)
|
||||
# generate ism_[d|f]tc_impl.[cpp|h]
|
||||
# ism_dtc_impl_custom.cpp/.h are real service sources (as in the qt5 legacy);
|
||||
# the BUILD_GRANTLEE=OFF copy of them onto codegen output paths was removed.
|
||||
IF(BUILD_GRANTLEE)
|
||||
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
|
||||
ELSEIF(BUILD_RTI)
|
||||
# Use pre-generated files when BUILD_GRANTLEE=OFF
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/ism_dtc_impl_custom.cpp ${CMAKE_CURRENT_BINARY_DIR}/ism_dtc_impl_custom.cpp COPYONLY)
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/ism_dtc_impl_custom.h ${CMAKE_CURRENT_BINARY_DIR}/ism_dtc_impl_custom.h COPYONLY)
|
||||
LIST(APPEND SRCS_client
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ism_dtc_impl_custom.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ism_dtc_impl_custom.h
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
NGL_ADD_LIBRARY(AAR SV WS HLA svcIsmClient SHARED ${SRCS_client})
|
||||
|
||||
Reference in new issue
Block a user