Skip to content

Commit

Permalink
OSX: Fix version in Info.plist
Browse files Browse the repository at this point in the history
Fixes #1552
  • Loading branch information
hluk committed Jan 1, 2021
1 parent f97a6ae commit 270b486
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Expand Up @@ -134,14 +134,17 @@ if(WITH_TESTS)
list(APPEND copyq_LIBRARIES Qt5::Test)
endif()

include(version.cmake)
message(STATUS "Building CopyQ version ${copyq_version}.")

# Generate version.h from current git commit if available.
add_custom_target(
generate_version_header
ALL
COMMAND ${CMAKE_COMMAND}
-D INPUT_FILE=${CMAKE_CURRENT_SOURCE_DIR}/src/common/version.h.in
-D OUTPUT_FILE=${CMAKE_CURRENT_BINARY_DIR}/src/common/version.h
-P ${CMAKE_CURRENT_SOURCE_DIR}/version.cmake
-P ${CMAKE_CURRENT_SOURCE_DIR}/version_header.cmake
BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/src/common/version.h
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
)
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Expand Up @@ -60,6 +60,10 @@ set(copyq_COMPILE
${copyq_QM}
)

if (NOT copyq_version)
message(FATAL_ERROR "Application version is unset")
endif()

if (NOT APPLE)
add_executable(${COPYQ_EXECUTABLE_NAME} ${copyq_COMPILE})
else()
Expand Down
4 changes: 0 additions & 4 deletions version.cmake
Expand Up @@ -20,7 +20,3 @@ else()
endif()
endif()
endif()

message(STATUS "Building CopyQ version ${copyq_version}.")

configure_file("${INPUT_FILE}" "${OUTPUT_FILE}")
2 changes: 2 additions & 0 deletions version_header.cmake
@@ -0,0 +1,2 @@
include(version.cmake)
configure_file("${INPUT_FILE}" "${OUTPUT_FILE}")

0 comments on commit 270b486

Please sign in to comment.