forked from CorsixTH/CorsixTH
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
108 lines (97 loc) · 2.66 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
# Project Declaration
PROJECT(AnimView)
# Generate source files list
# Note: do not use generic includes (*.cpp and such) this will break things with cmake
SET(animview_source_files
app.cpp
frmMain.cpp
frmSprites.cpp
rnc.cpp
th.cpp
tinystr.cpp
tinyxml.cpp
tinyxmlerror.cpp
tinyxmlparser.cpp
app.h
backdrop.h
frmMain.h
frmSprites.h
th.h
tinystr.h
tinyxml.h
AnimView.rc
)
# Declaration of the executable
IF(APPLE)
set(corsixth_icon_file ${CMAKE_SOURCE_DIR}/AnimView/Icon.icns)
set_source_files_properties(
${corsixth_icon_file}
PROPERTIES
MACOSX_PACKAGE_LOCATION Resources
)
set(MACOSX_BUNDLE_ICON_FILE Icon.icns)
add_executable(
AnimView
MACOSX_BUNDLE
${animview_source_files}
${corsixth_icon_file}
)
set_target_properties(AnimView PROPERTIES LINK_FLAGS_MINSIZEREL "-dead_strip")
set_target_properties(AnimView PROPERTIES XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../Frameworks")
ELSE()
add_executable(
AnimView
WIN32 # This prevents the dos console showing up
${animview_source_files}
)
ENDIF()
# Finding libraries
# Find WxWidgets
SET(wxWidgets_USE_LIBS core base) # optionally: more than wx std libs
FIND_PACKAGE(wxWidgets REQUIRED)
IF(wxWidgets_FOUND)
LINK_LIBRARIES(${wxWidgets_LIBRARIES})
INCLUDE_DIRECTORIES(${wxWidgets_INCLUDE_DIRS})
INCLUDE(${wxWidgets_USE_FILE})
TARGET_LINK_LIBRARIES(AnimView ${wxWidgets_LIBRARIES})
message(" wxWidgets found")
ELSE(wxWidgets_FOUND)
message(FATAL_ERROR "error: wxWdigets library not found, it is required to build")
message("Make sure the path is correctly defined or set the environment variable WXWIN to the correct location")
ENDIF(wxWidgets_FOUND)
# Basic platform dependant stuff
IF(UNIX)
IF(APPLE)
# fruit goes here
ELSE(APPLE)
# regular unix/linux
ENDIF(APPLE)
ELSE(UNIX)
IF(WIN32)
# Win32 specific
IF(MSVC)
# We want to bind against the very latest versions of the MSVC runtimes
add_definitions(/D "_BIND_TO_CURRENT_VCLIBS_VERSION=1")
ELSE(MSVC)
IF(MSYS)
# MSYS stuff
ELSE(MSYS)
# What's left? MINGW? CYGWIN? BORLAND?
ENDIF(MSYS)
ENDIF(MSVC)
ELSE(WIN32)
# other OS (not UNIX, not 32/64 bit Windows)
ENDIF(WIN32)
ENDIF(UNIX)
IF(APPLE)
install(TARGETS AnimView BUNDLE DESTINATION .)
# Fix the OS X bundle to include required libraries (create a redistributable app)
install(CODE "
INCLUDE(BundleUtilities)
SET(BU_CHMOD_BUNDLE_ITEMS ON)
FIXUP_BUNDLE(${CMAKE_INSTALL_PREFIX}/AnimView.app \"\" \"\")
")
ELSE()
install(TARGETS AnimView RUNTIME DESTINATION AnimView)
install(FILES LICENSE.txt DESTINATION AnimView )
ENDIF()