From 4c761df181fbe2028b4e991f83f5faef4f6ca623 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 1 Feb 2023 09:20:46 +0100 Subject: [PATCH] build: Improve build script a bit --- CMakeLists.txt | 8 ++++++-- cmake/build_helpers.cmake | 6 ++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6aa1b99d7..214527daf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,11 @@ include("${IMHEX_BASE_FOLDER}/cmake/build_helpers.cmake") # Setup project loadVersion(IMHEX_VERSION) setVariableInParent(IMHEX_VERSION ${IMHEX_VERSION}) -project(imhex VERSION ${IMHEX_VERSION}) +project(imhex + LANGUAGES C CXX VERSION ${IMHEX_VERSION} + DESCRIPTION "The ImHex Hex Editor" + HOMEPAGE_URL "https://imhex.werwolv.net" +) # Make sure project is configured correctly setDefaultBuiltTypeIfUnset() @@ -44,7 +48,7 @@ addBundledLibraries() # Add ImHex sources add_subdirectory(lib/libimhex) add_subdirectory(main) -add_custom_target(imhex_all ALL DEPENDS main) +add_custom_target(imhex ALL DEPENDS main libimhex ${PLUGINS}) # Add unit tests enable_testing() diff --git a/cmake/build_helpers.cmake b/cmake/build_helpers.cmake index 13a08ecc7..c65f5d0f2 100644 --- a/cmake/build_helpers.cmake +++ b/cmake/build_helpers.cmake @@ -184,8 +184,6 @@ macro(createPackage) install(TARGETS ${plugin} LIBRARY DESTINATION ${PLUGINS_INSTALL_LOCATION}) endif () endif () - - add_dependencies(imhex_all ${plugin}) endif () endforeach() @@ -256,7 +254,7 @@ macro(createPackage) set_property(TARGET main PROPERTY MACOSX_BUNDLE_INFO_PLIST ${MACOSX_BUNDLE_INFO_PLIST}) # Fix rpath - add_custom_command(TARGET imhex_all POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL} -add_rpath "@executable_path/../Frameworks/" $) + add_custom_command(TARGET imhex POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL} -add_rpath "@executable_path/../Frameworks/" $) # FIXME: Remove this once we move/integrate the plugins directory. add_custom_target(build-time-make-plugins-directory ALL COMMAND ${CMAKE_COMMAND} -E make_directory "${IMHEX_BUNDLE_PATH}/Contents/MacOS/plugins") @@ -269,7 +267,7 @@ macro(createPackage) install(FILES $ DESTINATION "${IMHEX_BUNDLE_PATH}") # Update library references to make the bundle portable - postprocess_bundle(imhex_all main) + postprocess_bundle(imhex main) # Enforce DragNDrop packaging. set(CPACK_GENERATOR "DragNDrop")