-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
87 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Author: Kang Lin ([email protected]) | ||
|
||
cmake_minimum_required(VERSION 2.8.12) | ||
|
||
if(POLICY CMP0100) | ||
cmake_policy(SET CMP0100 NEW) | ||
endif() | ||
|
||
if(POLICY CMP0077) | ||
cmake_policy(SET CMP0077 NEW) | ||
endif() | ||
|
||
project(QZXing) | ||
|
||
# TODO: Modify the version to the correct version | ||
SET(BUILD_VERSION "2.3") | ||
# Find Git Version Patch | ||
IF(EXISTS "${CMAKE_SOURCE_DIR}/.git") | ||
if(NOT GIT) | ||
SET(GIT $ENV{GIT}) | ||
endif() | ||
if(NOT GIT) | ||
FIND_PROGRAM(GIT NAMES git git.exe git.cmd) | ||
endif() | ||
IF(GIT) | ||
EXECUTE_PROCESS( | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
COMMAND ${GIT} describe --tags | ||
OUTPUT_VARIABLE GIT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
if(NOT GIT_VERSION) | ||
EXECUTE_PROCESS( | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
COMMAND ${GIT} rev-parse --short HEAD | ||
OUTPUT_VARIABLE GIT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
endif() | ||
SET(BUILD_VERSION ${GIT_VERSION}) | ||
ENDIF() | ||
ENDIF() | ||
message("BUILD_VERSION:${BUILD_VERSION}") | ||
set(VERSION ${BUILD_VERSION}) | ||
|
||
# Open qt compile tools | ||
SET(CMAKE_AUTOUIC ON) | ||
SET(CMAKE_AUTOMOC ON) | ||
SET(CMAKE_AUTORCC ON) | ||
SET(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
SET(CMAKE_VERBOSE_MAKEFILE ON) | ||
|
||
include(CMakePackageConfigHelpers) | ||
include(GNUInstallDirs) | ||
include(GenerateExportHeader) | ||
|
||
# Record the files that will need to be deleted | ||
CONFIGURE_FILE( | ||
"${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" | ||
"${CMAKE_BINARY_DIR}/cmake_uninstall.cmake" | ||
IMMEDIATE @ONLY) | ||
# Create delete target | ||
ADD_CUSTOM_TARGET(uninstall | ||
"${CMAKE_COMMAND}" -P "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake") | ||
|
||
SET(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libs") | ||
|
||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE) | ||
endif() | ||
|
||
add_subdirectory(src) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters