forked from MyGUI/mygui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfigureBuild.cmake
56 lines (46 loc) · 1.76 KB
/
ConfigureBuild.cmake
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
#######################################################################
# This file takes care of configuring MyGUI to build with the settings
# given in CMake. It creates the necessary config.h file and will
# also prepare package files for pkg-config and CMake.
#######################################################################
include(GNUInstallDirs)
# should we build static libs?
if (MYGUI_STATIC)
set(MYGUI_LIB_TYPE STATIC)
else ()
set(MYGUI_LIB_TYPE SHARED)
endif ()
set(MYGUI_STATIC_LIB 0)
if (MYGUI_STATIC)
set(MYGUI_STATIC_LIB 1)
add_definitions(-DMYGUI_STATIC)
endif()
if (WIN32)
configure_file(${MYGUI_TEMPLATES_DIR}/updateListFiles.bat.in ${MYGUI_BINARY_DIR}/updateListFiles.bat)
endif ()
# Create the pkg-config package files on Unix systems
if (UNIX)
set(MYGUI_LIB_SUFFIX "")
set(MYGUI_PLUGIN_PREFIX "")
set(MYGUI_PLUGIN_EXT ".so")
if (MYGUI_STATIC)
set(MYGUI_LIB_SUFFIX "${MYGUI_LIB_SUFFIX}Static")
set(MYGUI_PLUGIN_PREFIX "lib")
set(MYGUI_PLUGIN_EXT ".a")
endif ()
string(TOLOWER "${CMAKE_BUILD_TYPE}" MYGUI_BUILD_TYPE)
if (MYGUI_BUILD_TYPE STREQUAL "debug")
set(MYGUI_LIB_SUFFIX "${MYGUI_LIB_SUFFIX}_d")
endif ()
set(MYGUI_ADDITIONAL_LIBS "")
set(MYGUI_CFLAGS "")
set(MYGUI_PREFIX_PATH ${CMAKE_INSTALL_PREFIX})
set(MYGUI_ADDITIONAL_LIBS "${MYGUI_ADDITIONAL_LIBS}")
if (MYGUI_STATIC)
configure_file(${MYGUI_TEMPLATES_DIR}/MYGUIStatic.pc.in ${MYGUI_BINARY_DIR}/pkgconfig/MYGUI${MYGUI_LIB_SUFFIX}.pc @ONLY)
else ()
configure_file(${MYGUI_TEMPLATES_DIR}/MYGUI.pc.in ${MYGUI_BINARY_DIR}/pkgconfig/MYGUI${MYGUI_LIB_SUFFIX}.pc @ONLY)
endif ()
install(FILES ${MYGUI_BINARY_DIR}/pkgconfig/MYGUI${MYGUI_LIB_SUFFIX}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
# configure additional packages
endif ()