forked from d3x0r/sack.vfs
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.gui.txt
187 lines (145 loc) · 5.86 KB
/
CMakeLists.gui.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
set_property(GLOBAL PROPERTY USE_FOLDERS On)
cmake_minimum_required(VERSION 3.0)
project (sack_gui)
include( GNUInstallDirs )
ADD_DEFINITIONS( -DBUILD_NODE_ADDON )
if( NOT WIN32 )
ADD_DEFINITIONS( -D__LINUX__ )
else( NOT WIN32 )
ADD_DEFINITIONS( -D_CRT_NONSTDC_NO_DEPRECATE )
endif( NOT WIN32 )
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
SET( __64__ 1 )
ADD_DEFINITIONS( -D__64__ )
endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )
SET(CMAKE_SKIP_BUILD_RPATH TRUE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
if( CMAKE_COMPILER_IS_GNUCC )
SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Bsymbolic -Wl,--warn-unresolved-symbols" )
SET( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic -Wl,--warn-unresolved-symbols" )
endif( CMAKE_COMPILER_IS_GNUCC )
#ADD_DEFINITIONS( -DNO_OPEN_MACRO )
if( ${CMAKE_BUILD_TYPE} MATCHES "[dD][eE][bB][uU][gG]"
OR ${CMAKE_BUILD_TYPE} MATCHES "[rR][eE][lL][wW][iI].*" )
ADD_DEFINITIONS( -D_DEBUG )
endif( ${CMAKE_BUILD_TYPE} MATCHES "[dD][eE][bB][uU][gG]"
OR ${CMAKE_BUILD_TYPE} MATCHES "[rR][eE][lL][wW][iI].*" )
# visual studio headers change with _DEBUG defined... so it can't be release with _DEBUG defined
if( NOT CMAKE_CXX_FLAGS_RELWITHDEBINFO MATCHES "-D_DEBUG_INFO" )
set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG_INFO" )
endif( NOT CMAKE_CXX_FLAGS_RELWITHDEBINFO MATCHES "-D_DEBUG_INFO" )
# visual studio headers change with _DEBUG defined... so it can't be release with _DEBUG defined
if( NOT CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES "-D_DEBUG_INFO" )
set( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG_INFO" )
endif( NOT CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES "-D_DEBUG_INFO" )
include( ExternalProject )
if( WIN32 )
set( GIT_REPO file://m:/sack )
else( WIN32 )
set( GIT_REPO file:///home/git/sack )
endif( WIN32 )
if( NOT EXISTS GIT_REPO )
set( GIT_REPO git://github.com/d3x0r/sack )
endif( NOT EXISTS GIT_REPO )
ExternalProject_Add( sack
PREFIX sack-src
GIT_REPOSITORY ${GIT_REPO}
GIT_SHALLOW 1
INSTALL_DIR ${CMAKE_BINARY_DIR}/sack-${CMAKE_BUILD_TYPE}
CMAKE_ARGS -DNEED_JPEG=1 -DNEED_FREETYPE=1 -DNEED_PNG=1 -DNEED_ZLIB=1
-DSACK_LIBRARY_ONLY=1 -DUSE_SYSLOG_STDOUT_DEFAULT=ON
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/sack-${CMAKE_BUILD_TYPE}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DINCLUDE_EXTRAS=1 -DINCLUDE_VULKAN=0
)
if( EXISTS ${CMAKE_BINARY_DIR}/sack-src/src/sack/src/InterShell.stable )
ExternalProject_Add( intershell
PREFIX sack-src
DEPENDS sack
SOURCE_DIR ${CMAKE_BINARY_DIR}/sack-src/src/sack/src/InterShell.stable
INSTALL_DIR ${CMAKE_BINARY_DIR}/intershell-${CMAKE_BUILD_TYPE}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/sack-${CMAKE_BUILD_TYPE}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DSACK_SDK_ROOT_PATH=${CMAKE_BINARY_DIR}/sack-${CMAKE_BUILD_TYPE}
-DBUILD_INTO_SACK_INSTALL=1
)
LINK_DIRECTORIES( ${CMAKE_BINARY_DIR}/sack-${CMAKE_BUILD_TYPE}/${CMAKE_INSTALL_LIBDIR} )
set( DEFINITIONS USE_SQLITE USE_SQLITE_INTERFACE NO_FILEOP_ALIAS NO_OPEN_MACRO
_CRT_SECURE_NO_WARNINGS NEED_SHLAPI NEED_SHLOBJ
"SQLITE_ENABLE_LOCKING_STYLE=0" SACK_CORE INCLUDE_GUI
)
foreach( DEF ${DEFINITIONS} )
ADD_DEFINITIONS( -D${DEF} )
ENDFOREACH()
include_directories(${CMAKE_JS_INC} )
include_directories(${CMAKE_BINARY_DIR}/sack-${CMAKE_BUILD_TYPE}/include/SACK )
include_directories(${CMAKE_BINARY_DIR}/intershell-${CMAKE_BUILD_TYPE}/include/SACK )
if( WIN32 )
set( MORE_MODULE_SOURCES
src/hid_module.cc
src/reg_access.cc
src/playSound_module.cc
)
endif( WIN32 )
set( GUI_SOURCES src/gui/sack_psi_module.cc
src/gui/sack_systray.cc
src/gui/sack_image_module.cc
src/gui/sack_render_module.cc
src/gui/sack_intershell_module.cc
src/gui/sack_vulkan_module.cc
)
source_group( "Source Files\\GUI" FILES ${GUI_SOURCES} ) #REGULAR_EXPRESSION src/gui/.*)
set( PROJECT sack_gui )
add_library(${PROJECT} SHARED
src/com_interface.cc
src/fileMonitor_module.cc
src/jsonParse.cc
src/jsoxParse.cc
src/playSound_module.cc
src/network_module.cc
src/objStore_module.cc
src/sql_module.cc
src/srg_module.cc
src/system_module.cc
src/task_module.cc
src/text_object.cc
src/thread_module.cc
src/tls_interface.cc
src/websocket_module.cc
src/vfs_module.cc
src/system_module.cc
src/text_object.cc
${MORE_MODULE_SOURCES}
${GUI_SOURCES}
)
set_target_properties(${PROJECT} PROPERTIES PREFIX "" SUFFIX ".node")
if( CMAKE_COMPILER_IS_GNUCC )
set_target_properties(${PROJECT} PROPERTIES COMPILE_FLAGS "-Wno-unused-result")
endif( CMAKE_COMPILER_IS_GNUCC )
set_target_properties(${PROJECT} PROPERTIES COMPILE_DEFINITIONS "BUILDING_NODE_EXTENSION;TARGETNAME=\"${PROJECT}.node\";${MOREDEFS}" )
add_dependencies( ${PROJECT} sack intershell )
if( UNIX )
set( VFSLIB :sack_vfs.pp.module )
set( EXTRACOPY
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/sack-${CMAKE_BUILD_TYPE}/${CMAKE_INSTALL_LIBDIR} ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}
)
else( UNIX )
set( VFSLIB sack_vfs.pp.module )
endif( UNIX )
target_link_libraries(${PROJECT} bag++ bag.externals bag.psi++ ${VFSLIB} ${CMAKE_JS_LIB} )
add_custom_command( TARGET ${PROJECT} POST_BUILD
#COMMAND cmake -E echo ${AMALG_COMMAND}
COMMAND ${CMAKE_COMMAND} -E echo Updating deps....
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/sack-${CMAKE_BUILD_TYPE}/bin ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/sack-${CMAKE_BUILD_TYPE}/resources ${CMAKE_BINARY_DIR}/resources
${EXTRACOPY}
DEPENDS ${PROJECT}
)
if( WIN32 )
target_link_libraries(${PROJECT} winmm ws2_32 rpcrt4 iphlpapi odbc32 psapi ntdll )
endif( WIN32 )
if( UNIX )
target_link_libraries( ${PROJECT} uuid )
endif( UNIX )
endif( EXISTS ${CMAKE_BINARY_DIR}/sack-src/src/sack/src/InterShell.stable )