Skip to content

Commit

Permalink
build: Make ImHex buildable again from plugin projects
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Feb 8, 2022
1 parent 56277ae commit 3539b42
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ set(IMHEX_VERSION "1.14.0")
project(imhex VERSION ${IMHEX_VERSION})

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
set(IMHEX_BASE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR})
include("${CMAKE_SOURCE_DIR}/cmake/build_helpers.cmake")
set(CMAKE_MODULE_PATH "${IMHEX_BASE_FOLDER}/cmake/modules")
include("${IMHEX_BASE_FOLDER}/cmake/build_helpers.cmake")

# Make sure project is configured correctly
setDefaultBuiltTypeIfUnset()
Expand Down
12 changes: 6 additions & 6 deletions cmake/build_helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ macro(addVersionDefines)
set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} -DPROJECT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} -DPROJECT_VERSION_MINOR=${PROJECT_VERSION_MINOR} -DPROJECT_VERSION_PATCH=${PROJECT_VERSION_PATCH} ")

add_compile_definitions(
$<$<CONFIG:Release>:IMHEX_VERSION="${PROJECT_VERSION}">
$<$<CONFIG:Debug>:IMHEX_VERSION="${PROJECT_VERSION}-Debug">
$<$<CONFIG:RelWithDebInfo>:IMHEX_VERSION="${PROJECT_VERSION}-ReleaseWithDebugInfo">
$<$<CONFIG:MinSizeRel>:IMHEX_VERSION="${PROJECT_VERSION}-ReleaseMinimumSize">
$<$<CONFIG:Release>:IMHEX_VERSION="${IMHEX_VERSION}">
$<$<CONFIG:Debug>:IMHEX_VERSION="${IMHEX_VERSION}-Debug">
$<$<CONFIG:RelWithDebInfo>:IMHEX_VERSION="${IMHEX_VERSION}-ReleaseWithDebugInfo">
$<$<CONFIG:MinSizeRel>:IMHEX_VERSION="${IMHEX_VERSION}-ReleaseMinimumSize">
)

add_compile_definitions(
Expand Down Expand Up @@ -106,7 +106,7 @@ macro(configurePackingResources)

if (WIN32)
set(APPLICATION_TYPE)
set(IMHEX_ICON "${CMAKE_SOURCE_DIR}/resources/resource.rc")
set(IMHEX_ICON "${IMHEX_BASE_FOLDER}/resources/resource.rc")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--allow-multiple-definition")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-subsystem,windows")

Expand All @@ -123,7 +123,7 @@ macro(configurePackingResources)
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/resources/LICENSE.rtf")
endif()
elseif (APPLE)
set (IMHEX_ICON "${CMAKE_SOURCE_DIR}/resources/AppIcon.icns")
set (IMHEX_ICON "${IMHEX_BASE_FOLDER}/resources/AppIcon.icns")

if (CREATE_BUNDLE)
set(APPLICATION_TYPE MACOSX_BUNDLE)
Expand Down

0 comments on commit 3539b42

Please sign in to comment.