-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
111 lines (97 loc) · 3.47 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#
# File:
# CMakeLists.txt
#
# Description:
# Definitions to create the build environment with cmake
#
# Documentation:
# See the CMake documentation.
#
# License:
# Copyright (c) 2011-2013 Made to Order Software Corp.
#
# http://snapwebsites.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
cmake_minimum_required(VERSION 3.3.0)
project( unigw )
################################################################################
# Load up necessary modules
#
set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake )
find_package( WpkgBuild REQUIRED )
set( UNIGW_VERSION "1.0.2" CACHE STRING "WPKG version." )
option( BUILD_PKGEXPLORER "Enable the build of pkg-explorer" OFF )
if( NOT CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE Release )
endif()
################################################################################
# WPKG libraries
#
# NOTE: I'm disabling all of the debug packages because they really aren't needed
# (you can build your own debug version from source), and also because it's a right pain
# in the keester.
#
unigw_ConfigureMakeProject(
PROJECT_NAME wpkg
BUILD_TYPE ${CMAKE_BUILD_TYPE}
CONFIG_ARGS -DWPKG_VERSION=${UNIGW_VERSION} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}
)
if( BUILD_PKGEXPLORER )
unigw_ConfigureMakeProject(
PROJECT_NAME pkg-explorer
DEPENDS wpkg-${CMAKE_BUILD_TYPE}
BUILD_TYPE ${CMAKE_BUILD_TYPE}
CONFIG_ARGS -DWPKG_VERSION=${UNIGW_VERSION}
)
endif()
get_property( BUILD_TARGETS GLOBAL PROPERTY BUILD_TARGETS )
get_property( CLEAN_TARGETS GLOBAL PROPERTY CLEAN_TARGETS )
#
if( UNIX )
get_property( PACKAGE_TARGETS GLOBAL PROPERTY PACKAGE_TARGETS )
get_property( DPUT_TARGETS GLOBAL PROPERTY DPUT_TARGETS )
get_property( PBUILDER_TARGETS GLOBAL PROPERTY PBUILDER_TARGETS )
endif()
add_custom_target( build-all ALL
DEPENDS ${BUILD_TARGETS}
)
add_custom_target( clean-all
COMMAND ${CMAKE_COMMAND} ${CMAKE_BINARY_DIR}
DEPENDS ${CLEAN_TARGETS}
)
if( MSVC OR MINGW )
add_subdirectory( win32 )
endif()
if( UNIX )
add_custom_target( debuild
DEPENDS ${PACKAGE_TARGETS}
)
add_custom_target( dput
DEPENDS ${DPUT_TARGETS}
)
add_custom_target( pbuilder
DEPENDS ${PBUILDER_TARGETS}
)
endif()
# vim: ts=4 sw=4 et nocindent