From a726b7bccbf323eddb956f5de56636b592c189ca Mon Sep 17 00:00:00 2001 From: Christophe VG Date: Mon, 2 Feb 2015 13:42:02 +0100 Subject: [PATCH 1/2] added git build number to version string for DMG --- CMakeLists.txt | 41 ++++++++++++++++++++--------------------- src/app/CMakeLists.txt | 2 +- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb62606..dfb998f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,27 +74,6 @@ if(Boost_FOUND) endif() -# -# Include subdirectories -# - -# Include the subdirectories -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}) -INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/src/app") -INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/src/hrlib") -INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/src/patheditor") -INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/src/foillogic") -INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/src/foileditors") -INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/submodules/jenson/src") -INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/submodules/qtunits/src") - -add_subdirectory(src/app) -if(Tests) - find_package(Qt5Test REQUIRED) - add_subdirectory(tests/unittests) -endif() - - # # Try to set build number and commit hash # @@ -124,3 +103,23 @@ if(${GIT_BUILD_NUMBER}) else() message(WARNING "Not building from a git repository, the build number cannot be updated.") endif() + +# +# Include subdirectories +# + +# Include the subdirectories +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}) +INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/src/app") +INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/src/hrlib") +INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/src/patheditor") +INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/src/foillogic") +INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/src/foileditors") +INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/submodules/jenson/src") +INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/submodules/qtunits/src") + +add_subdirectory(src/app) +if(Tests) + find_package(Qt5Test REQUIRED) + add_subdirectory(tests/unittests) +endif() diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index a07087a..fa2871f 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -115,7 +115,7 @@ if (APPLE) add_custom_command( TARGET ${BINARY_NAME} POST_BUILD - COMMAND ../scripts/create-dmg.sh ${BINARY_NAME}.app ${MAJOR_VERSION}.${MINOR_VERSION}.${REVISION} ${ICNS} + COMMAND ../scripts/create-dmg.sh ${BINARY_NAME}.app ${MAJOR_VERSION}.${MINOR_VERSION}.${REVISION}-${GIT_BUILD_NUMBER} ${ICNS} WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ) From 6ed293b4131f7fd6fb1f332b72fcc6f86138367c Mon Sep 17 00:00:00 2001 From: Christophe VG Date: Mon, 2 Feb 2015 14:56:59 +0100 Subject: [PATCH 2/2] temporary fix for bad icns copy order --- scripts/create-dmg.sh | 4 ++++ src/app/CMakeLists.txt | 2 ++ 2 files changed, 6 insertions(+) diff --git a/scripts/create-dmg.sh b/scripts/create-dmg.sh index b577286..730e9e5 100755 --- a/scripts/create-dmg.sh +++ b/scripts/create-dmg.sh @@ -4,6 +4,7 @@ APP=$1 VERSION=$2 +ICNS=$3 BUNDLE=$(basename ${APP}) NAME=${BUNDLE%.*}-${VERSION} @@ -21,6 +22,9 @@ cd stage/ ln -s /Applications . mkdir .background cp ../../src/resources/background.png .background/background.png +# TODO: temp fix for bad order of copying icns file to app bundle +mkdir -p ${BUNDLE}/Contents/Resources/ +cp ${ICNS} ${BUNDLE}/Contents/Resources/ cd .. # step 3: create new disk image diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index fa2871f..5a0c3ad 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -24,6 +24,8 @@ set(HDR if (APPLE) set(MACOSX_BUNDLE_ICON_FILE ${BINARY_NAME}.icns) set(ICNS ${CMAKE_BINARY_DIR}/${BINARY_NAME}.icns) + # TODO: this seems to copy the icns file to the .app bundle AFTER the DMG + # is constructed. for now, the copying is done by the DMG creation set_source_files_properties(${ICNS} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") # custom command to generate iconset when its source is needed