find_package for HogMaker in parent scope to get target exported properly

This commit is contained in:
Louis Gombert 2024-10-27 20:16:17 +01:00
parent 73d2c5803c
commit 95fc3d2ce4
2 changed files with 13 additions and 12 deletions

View File

@ -275,7 +275,12 @@ endif()
add_subdirectory(Descent3)
if (CMAKE_CROSSCOMPILING)
find_package(HogMaker REQUIRED)
else()
add_subdirectory(tools)
endif()
add_subdirectory(netcon)
add_subdirectory(netgames)
add_subdirectory(scripts)

View File

@ -1,6 +1,3 @@
if(CMAKE_CROSSCOMPILING)
find_package(HogMaker)
else()
add_executable(
HogMaker
HogMaker/HogFormat.cpp
@ -8,4 +5,3 @@ else()
)
target_include_directories(HogMaker PRIVATE ${PROJECT_BINARY_DIR}/lib)
export(TARGETS HogMaker FILE "${CMAKE_BINARY_DIR}/HogMakerConfig.cmake")
endif()