zint/CMakeLists.txt

83 lines
3.0 KiB
CMake
Raw Normal View History

2008-09-19 02:44:52 +12:00
# (c) 2008 by BogDan Vatra < bogdan@licentia.eu >
cmake_minimum_required(VERSION 2.6)
project(zint-package)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
2008-10-03 22:50:13 +13:00
#set(CMAKE_VERBOSE_MAKEFILE ON)
2008-09-19 02:51:21 +12:00
#comment or remove the above line before release
2008-09-19 02:44:52 +12:00
2008-11-18 21:52:43 +13:00
set (ZINT_VERSION_MAJOR 2)
2009-11-09 11:17:11 +13:00
set (ZINT_VERSION_MINOR 3)
set (ZINT_VERSION_RELEASE 0)
2008-09-19 02:44:52 +12:00
set (ZINT_VERSION "${ZINT_VERSION_MAJOR}.${ZINT_VERSION_MINOR}.${ZINT_VERSION_RELEASE}" )
2008-09-29 00:19:33 +13:00
add_definitions (-DZINT_VERSION=\"${ZINT_VERSION}\" -Wall)
2008-09-19 02:44:52 +12:00
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
2008-09-24 21:00:44 +12:00
include (SetPaths.cmake)
2009-05-22 09:00:23 +12:00
INCLUDE (CheckCXXCompilerFlag)
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
check_cxx_compiler_flag("-Wall" CXX_COMPILER_FLAG_WALL)
if (CXX_COMPILER_FLAG_WALL)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
endif (CXX_COMPILER_FLAG_WALL)
endif (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
IF(APPLE)
IF(NOT ZINT_HAS_BEEN_RUN_BEFORE)
IF(EXISTS /Developer/SDKs/MacOSX10.5.sdk OR EXISTS /SDKs/MacOSX10.5.sdk)
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386;ppc64;x86_64" CACHE STRING "Build architectures for OSX" FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
ELSE(EXISTS /Developer/SDKs/MacOSX10.5.sdk OR EXISTS /SDKs/MacOSX10.5.sdk)
IF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk OR EXISTS /SDKs/MacOSX10.4u.sdk)
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
ENDIF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk OR EXISTS /SDKs/MacOSX10.4u.sdk)
ENDIF(EXISTS /Developer/SDKs/MacOSX10.5.sdk OR EXISTS /SDKs/MacOSX10.5.sdk)
message("Build architectures for OSX:${CMAKE_OSX_ARCHITECTURES}")
ENDIF(NOT ZINT_HAS_BEEN_RUN_BEFORE)
ENDIF(APPLE)
2008-09-19 02:44:52 +12:00
add_subdirectory(backend)
add_subdirectory(frontend)
find_package(Qt4)
2009-05-22 09:00:23 +12:00
2008-09-19 02:44:52 +12:00
if (QT4_FOUND)
set( QT_USE_QTGUI TRUE )
2009-05-22 09:00:23 +12:00
set( QT_USE_QTUITOOLS TRUE )
2009-05-26 06:40:32 +12:00
set( QT_USE_QTXML TRUE )
2008-09-19 02:44:52 +12:00
include( ${QT_USE_FILE} )
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
2008-09-19 02:44:52 +12:00
${QT_INCLUDE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
add_subdirectory(backend_qt4)
add_subdirectory(frontend_qt4)
endif(QT4_FOUND)
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
install(FILES cmake/modules/FindZint.cmake DESTINATION ${CMAKE_ROOT}/Modules COMPONENT Devel)
# This needs to be run very last so other parts of the scripts can take
# advantage of this.
IF(NOT ZINT_HAS_BEEN_RUN_BEFORE)
SET(ZINT_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before")
ENDIF(NOT ZINT_HAS_BEEN_RUN_BEFORE)