Skip to content

Commit

Permalink
cmake: 3.2.0 update
Browse files Browse the repository at this point in the history
  • Loading branch information
rp- committed Jul 6, 2014
1 parent 1475754 commit 91d618e
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,28 +106,14 @@ else()
endif()

# get git version hash
if(EXISTS ${CMAKE_SOURCE_DIR}/.git)
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/src/gen_version.h
COMMAND echo "#ifndef __VERSION_H__" > ${CMAKE_SOURCE_DIR}/src/gen_version.h
COMMAND echo "#define __VERSION_H__" >> ${CMAKE_SOURCE_DIR}/src/gen_version.h
COMMAND git log -n1 "--format=#define APP_VERSION \"%h_git\"" >> ${CMAKE_SOURCE_DIR}/src/gen_version.h
COMMAND echo "#define MAJOR_VERSION 999" >> ${CMAKE_SOURCE_DIR}/src/gen_version.h
COMMAND echo "#define MINOR_VERSION 0" >> ${CMAKE_SOURCE_DIR}/src/gen_version.h
COMMAND echo "#define PATCH_VERSION 0" >> ${CMAKE_SOURCE_DIR}/src/gen_version.h
COMMAND echo "#endif" >> ${CMAKE_SOURCE_DIR}/src/gen_version.h
DEPENDS .git/HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
VERBATIM)
else()
file(WRITE ${CMAKE_SOURCE_DIR}/src/gen_version.h
file(WRITE ${CMAKE_SOURCE_DIR}/src/gen_version.h
"#ifndef __GEN_VERSIONS_H__\n"
"#define __GEN_VERSIONS_H__\n"
"#define APP_VERSION \"3.0.1\"\n"
"#define APP_VERSION \"3.2.0\"\n"
"#define MAJOR_VERSION 3\n"
"#define MINOR_VERSION 0\n"
"#define PATCH_VERSION 1\n"
"#define MINOR_VERSION 2\n"
"#define PATCH_VERSION 0\n"
"#endif")
endif()

#icon and correct libs/subsystem for windows
if(WIN32)
Expand Down Expand Up @@ -200,7 +186,7 @@ set(CPACK_PACKAGE_VENDOR "oldsch00l")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_PACKAGE_VERSION_MAJOR "3")
set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "2")
set(CPACK_PACKAGE_VERSION_PATCH "0")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "SqliteBrowser${CPACK_PACKAGE_VERSION_MAJOR}")
if(WIN32 AND NOT UNIX)
Expand Down

0 comments on commit 91d618e

Please sign in to comment.