2011-08-19 18:59:21 +00:00
|
|
|
project(updater)
|
|
|
|
|
|
|
|
cmake_minimum_required(VERSION 2.6)
|
2013-08-29 14:17:58 +00:00
|
|
|
enable_testing()
|
2011-08-29 16:40:25 +00:00
|
|
|
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
|
2011-08-19 18:59:21 +00:00
|
|
|
|
2011-09-05 15:47:07 +00:00
|
|
|
# If the SIGN_UPDATER option is enabled, the updater.exe
|
|
|
|
# binary is digitally signed on Windows after it has been built.
|
2013-08-29 14:59:19 +00:00
|
|
|
#
|
|
|
|
# The script used to sign the binary is specified by BINARY_SIGNING_TOOL.
|
|
|
|
# This tool must take a single argument which is the filename of the
|
|
|
|
# binary to sign.
|
|
|
|
option(SIGN_UPDATER "Enable signing of the updater binary" OFF)
|
|
|
|
set(BINARY_SIGNING_TOOL sign-updater.bat CACHE PATH "Path to the tool used to sign the updater")
|
2011-09-05 15:47:07 +00:00
|
|
|
|
2011-08-19 18:59:21 +00:00
|
|
|
include_directories(external)
|
2011-08-22 13:00:00 +00:00
|
|
|
include_directories(external/TinyThread/source)
|
2011-08-19 18:59:21 +00:00
|
|
|
|
2011-08-22 15:37:53 +00:00
|
|
|
if (WIN32)
|
|
|
|
include_directories(external/zlib/)
|
2011-09-05 14:47:40 +00:00
|
|
|
include_directories(external/bzip2)
|
2011-08-23 18:54:52 +00:00
|
|
|
include_directories(external/win32cpp/include)
|
2011-09-15 17:34:45 +00:00
|
|
|
|
|
|
|
# Link the updater binary statically with the Visual C++ runtime
|
|
|
|
# so that the executable can function standalone
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG")
|
|
|
|
set(CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG")
|
2011-10-04 22:06:59 +00:00
|
|
|
|
|
|
|
else()
|
|
|
|
# optimize for reduced code size
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-Os")
|
|
|
|
set(CMAKE_C_FLAGS_RELEASE "-Os")
|
2011-08-22 15:37:53 +00:00
|
|
|
endif()
|
|
|
|
|
2011-08-23 15:46:09 +00:00
|
|
|
if (APPLE)
|
2011-09-02 13:16:47 +00:00
|
|
|
# Build the updater as a dual 32/64bit binary. If only one architecture
|
|
|
|
# is required, removing the other architecture will reduce the size
|
|
|
|
# of the updater binary
|
2011-08-23 15:46:09 +00:00
|
|
|
set(CMAKE_OSX_ARCHITECTURES i386;x86_64)
|
2011-08-30 11:53:09 +00:00
|
|
|
|
|
|
|
# Build the updater so that it works on OS X 10.5 and above.
|
2013-08-29 14:25:04 +00:00
|
|
|
set(MIN_OSX_VERSION 10.5)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=${MIN_OSX_VERSION}")
|
2011-08-23 15:46:09 +00:00
|
|
|
endif()
|
|
|
|
|
2011-08-19 18:59:21 +00:00
|
|
|
add_subdirectory(src)
|
|
|
|
add_subdirectory(external/AnyOption)
|
2011-08-19 23:38:05 +00:00
|
|
|
add_subdirectory(external/minizip)
|
2011-08-19 18:59:21 +00:00
|
|
|
add_subdirectory(external/tinyxml)
|
2011-08-22 13:00:00 +00:00
|
|
|
add_subdirectory(external/TinyThread)
|
2011-08-19 18:59:21 +00:00
|
|
|
|