-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathCMakeLists.txt
163 lines (125 loc) · 4.95 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
cmake_minimum_required(VERSION 2.8)
# The name of our project is "HELLO". CMakeLists files in this project can
# refer to the root source directory of the project as ${HELLO_SOURCE_DIR} and
# to the root binary directory of the project as ${HELLO_BINARY_DIR}.
project (FriiDump)
if (MSVC)
# msvc2005 deprecated warnings
add_definitions (-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
else (MSVC)
if (NOT WIN32)
add_definitions (-fPIC)
endif (NOT WIN32)
endif (MSVC)
include (TestBigEndian)
test_big_endian (CMAKE_WORDS_BIGENDIAN)
include (CheckIncludeFiles)
check_include_files (stdbool.h HAVE_STDBOOL_H)
include (CheckFunctionExists)
check_function_exists (fseeko HAVE_FSEEKO)
check_function_exists (ftello HAVE_FTELLO)
check_function_exists (fseek64 HAVE_FSEEK64)
check_function_exists (ftell64 HAVE_FTELL64)
include(CheckTypeSize)
set (CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64)
set (CMAKE_EXTRA_INCLUDE_FILES sys/types.h)
check_type_size ("off_t" OFF_T)
set (CMAKE_EXTRA_INCLUDE_FILES)
set (CMAKE_EXTRA_INCLUDE_FILES stdio.h)
check_type_size ("fpos_t" FPOS_T)
set (CMAKE_EXTRA_INCLUDE_FILES)
set (CMAKE_REQUIRED_DEFINITIONS)
option (
DEBUG
"Enable debugging messages"
OFF
)
option (
BUILD_STATIC_BINARY
"Build a static binary (has precedence over ALL_LIBS_SHARED)"
OFF
)
option (
BUILD_ALL_LIBS_SHARED
"Build all libraries as shared"
OFF
)
if (BUILD_STATIC_BINARY)
set (libmultihash_type STATIC)
set (libfriidump_type STATIC)
elseif (BUILD_ALL_LIBS_SHARED)
set (libmultihash_type SHARED)
set (libfriidump_type SHARED)
else (BUILD_STATIC_BINARY)
# This is how we build libraries by default
set (libmultihash_type STATIC)
set (libfriidump_type SHARED)
endif (BUILD_STATIC_BINARY)
# set (CMAKE_BUILD_TYPE superoptimized)
set (CMAKE_C_FLAGS_SUPEROPTIMIZED "-march=athlon-xp -m3dnow -O3 -funroll-all-loops")
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall")
# set (CMAKE_BUILD_TYPE release)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
add_definitions(-DHAVE_CONFIG_H)
include_directories (
${FriiDump_BINARY_DIR}
)
# Recurse into the "Hello" and "Demo" subdirectories. This does not actually
# cause another cmake executable to run. The same process will walk through
# the project's entire directory structure.
add_subdirectory (libmultihash)
add_subdirectory (libfriidump)
add_subdirectory (src)
if (WIN32)
install (FILES AUTHORS DESTINATION / RENAME Authors.txt)
#install (CODE "exec_program (${CMAKE_CURRENT_SOURCE_DIR}/utils/unix2dos.exe ${CMAKE_OUTPUT_BINARY_DIR} ARGS Authors.txt)")
install (FILES ChangeLog DESTINATION / RENAME ChangeLog.txt)
install (FILES COPYING DESTINATION / RENAME Copying.txt)
install (FILES README DESTINATION / RENAME ReadMe.txt)
install (FILES TODO DESTINATION / RENAME ToDo.txt)
endif (WIN32)
# CPack stuff
include (InstallRequiredSystemLibraries)
set (CPACK_PACKAGE_NAME "friidump")
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Dump Nintendo GameCube/Wii discs")
set (CPACK_PACKAGE_VENDOR "Arep")
set (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
set (CPACK_PACKAGE_VERSION_MAJOR "0")
set (CPACK_PACKAGE_VERSION_MINOR "3")
set (CPACK_PACKAGE_VERSION_PATCH "0")
set (CPACK_PACKAGE_INSTALL_DIRECTORY "FriiDump ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set (CPACK_PACKAGE_EXECUTABLES "friidump" "FriiDump")
set (CPACK_SOURCE_GENERATOR "TBZ2;ZIP")
set (CPACK_SOURCE_IGNORE_FILES
"/CVS/"
"/\\\\.svn/"
"~$"
"tags"
"\\\\.kdevses$"
"\\\\.kdevelop\\\\.pcs$"
"/BUILD.*/"
"/RELEASES/"
"/utils/"
"/doc.*/"
)
set (CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
if(WIN32 AND NOT UNIX)
set (CPACK_GENERATOR "NSIS;ZIP")
# There is a bug in NSI that does not handle full unix paths properly. Make
# sure there is at least one set of four (4) backlasshes.
# set (CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
# set (CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\MyExecutable.exe")
set (CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} installer")
set (CPACK_NSIS_HELP_LINK "http:\\\\\\\\wii.console-tribe.com")
set (CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.my-personal-home-page.com")
set (CPACK_NSIS_CONTACT "arep@no.net")
set (CPACK_NSIS_MODIFY_PATH ON)
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-Win32")
else(WIN32 AND NOT UNIX)
set (CPACK_GENERATOR "TBZ2")
set (CPACK_STRIP_FILES "bin/friidump;lib/libfriidump.so.1.0.0")
# set (CPACK_SOURCE_STRIP_FILES "")
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-LinuxBin")
endif(WIN32 AND NOT UNIX)
include (CPack)