From 51880fc2a83cfaaea2e8502e17f81db9a4be956e Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 27 Sep 2023 15:13:58 +0200 Subject: [PATCH] build: Fixed build/install of refactored forwarder --- CMakeLists.txt | 3 ++- lib/libimhex/CMakeLists.txt | 4 +++- main/forwarder/CMakeLists.txt | 6 ++++-- main/gui/CMakeLists.txt | 5 +++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd47856c9..bd95c0bec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,9 +52,10 @@ setUninstallTarget() addBundledLibraries() # Add ImHex sources +add_custom_target(imhex_all ALL) + add_subdirectory(lib/libimhex) add_subdirectory(main) -add_custom_target(imhex_all ALL DEPENDS main main-forwarder libimhex) # Add unit tests enable_testing() diff --git a/lib/libimhex/CMakeLists.txt b/lib/libimhex/CMakeLists.txt index 3b0f915f5..117239a36 100644 --- a/lib/libimhex/CMakeLists.txt +++ b/lib/libimhex/CMakeLists.txt @@ -119,4 +119,6 @@ if ((NOT GIT_COMMIT_HASH_SHORT STREQUAL "") AND (NOT GIT_COMMIT_HASH_LONG STREQU addDefineToSource(source/api/imhex_api.cpp "GIT_BRANCH=\"${GIT_BRANCH}\"") endif () -addDefineToSource(source/api/imhex_api.cpp "IMHEX_VERSION=\"${IMHEX_VERSION_STRING}\"") \ No newline at end of file +addDefineToSource(source/api/imhex_api.cpp "IMHEX_VERSION=\"${IMHEX_VERSION_STRING}\"") + +add_dependencies(imhex_all libimhex) \ No newline at end of file diff --git a/main/forwarder/CMakeLists.txt b/main/forwarder/CMakeLists.txt index b9a907713..44592a93d 100644 --- a/main/forwarder/CMakeLists.txt +++ b/main/forwarder/CMakeLists.txt @@ -5,8 +5,10 @@ add_executable(main-forwarder ${IMHEX_ICON} ) target_link_libraries(main-forwarder PRIVATE libwolv-io ${FMT_LIBRARIES}) +add_dependencies(imhex_all main-forwarder) set_target_properties(main-forwarder PROPERTIES OUTPUT_NAME "imhex" - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/.. + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../.. CXX_VISIBILITY_PRESET hidden - POSITION_INDEPENDENT_CODE ON) \ No newline at end of file + POSITION_INDEPENDENT_CODE ON) + diff --git a/main/gui/CMakeLists.txt b/main/gui/CMakeLists.txt index 0512b0fcf..69dbdf92f 100644 --- a/main/gui/CMakeLists.txt +++ b/main/gui/CMakeLists.txt @@ -27,10 +27,11 @@ set(LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/romfs) set(LIBROMFS_PROJECT_NAME imhex) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../lib/external/libromfs ${CMAKE_CURRENT_BINARY_DIR}/main/gui/libromfs EXCLUDE_FROM_ALL) set_target_properties(${LIBROMFS_LIBRARY} PROPERTIES POSITION_INDEPENDENT_CODE ON) +add_dependencies(imhex_all main) set_target_properties(main PROPERTIES OUTPUT_NAME ${IMHEX_APPLICATION_NAME} - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/.. + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../.. CXX_VISIBILITY_PRESET hidden POSITION_INDEPENDENT_CODE ON) @@ -45,4 +46,4 @@ endif () if (APPLE) add_compile_definitions(GL_SILENCE_DEPRECATION) -endif () +endif () \ No newline at end of file