forked from QbProg/oce-win-bundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
61 lines (48 loc) · 2 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
cmake_minimum_required(VERSION 2.6)
# Define helper macro option_with_default
macro( option_with_default OPTION_NAME OPTION_STRING OPTION_DEFAULT )
if( NOT DEFINED ${OPTION_NAME} )
set( ${OPTION_NAME} ${OPTION_DEFAULT} )
endif( NOT DEFINED ${OPTION_NAME} )
option( ${OPTION_NAME} "${OPTION_STRING}" ${${OPTION_NAME}} )
endmacro( option_with_default OPTION_NAME OPTION_STRING OPTION_DEFAULT )
PROJECT(oce-win-bundle)
SET(CMAKE_DEBUG_POSTFIX "d")
SET(FT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs/freetype)
SET(GL2PS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs/gl2ps)
SET(FREEIMAGE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs/FreeImage)
SET(LIBPNG_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs/FreeImage/Source/LibPNG/)
SET(ZLIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs/FreeImage/Source/zlib/)
OPTION_WITH_DEFAULT(BUNDLE_SHARED_LIBRARIES "Build shared libraries" ON)
OPTION_WITH_DEFAULT(BUNDLE_BUILD_FREETYPE "Build freetype" ON)
OPTION_WITH_DEFAULT(BUNDLE_BUILD_GL2PS "Build gl2ps" ON)
OPTION_WITH_DEFAULT(BUNDLE_BUILD_FREEIMAGE "Build freeimage" ON)
IF (${CMAKE_SIZEOF_VOID_P} MATCHES "8") # It is 64bit, otherwise 32 bit systems match 4
ADD_DEFINITIONS(-D_OCC64)
SET(BIT 64)
ELSE (${CMAKE_SIZEOF_VOID_P} MATCHES "8")
SET(BIT 32)
ENDIF(${CMAKE_SIZEOF_VOID_P} MATCHES "8")
IF( NOT DEFINED OCE_WIN_BUNDLE_INSTALL_DIR )
IF( WIN32 )
SET( OCE_WIN_BUNDLE_INSTALL_DIR "c:/oce-win-bundle")
ENDIF( WIN32 )
ENDIF( NOT DEFINED OCE_WIN_BUNDLE_INSTALL_DIR )
IF(BUNDLE_SHARED_LIBRARIES)
SET(BUNDLE_LIB_MODIFIER "SHARED")
ELSE()
SET(BUNDLE_LIB_MODIFIER "")
ENDIF()
SET( OCE_WIN_BUNDLE_INSTALL_DIR ${OCE_WIN_BUNDLE_INSTALL_DIR} CACHE
PATH "Install prefix prepended to target to create install location" )
SET( OCE_WIN_BUNDLE_INSTALL_DIR_BITS ${OCE_WIN_BUNDLE_INSTALL_DIR}/Win${BIT}/)
IF(BUNDLE_BUILD_FREETYPE)
ADD_SUBDIRECTORY(freetype.cmake)
ENDIF()
IF(BUNDLE_BUILD_GL2PS)
ADD_SUBDIRECTORY(gl2ps.cmake)
ENDIF()
IF(BUNDLE_BUILD_FREEIMAGE)
ADD_SUBDIRECTORY(FreeImage.cmake)
ENDIF()
INSTALL(FILES ./oce-bundle-root.empty DESTINATION ${OCE_WIN_BUNDLE_INSTALL_DIR})