1 IF(WITH_RYZOM_TOOLS OR WITH_RYZOM_CLIENT)
2 # Need clientsheets lib for sheets packer tool
3 ADD_SUBDIRECTORY(client_sheets)
8 MESSAGE(FATAL_ERROR "The client cannot be built without the NeL GUI Library (WITH_GUI)")
11 # Patch should never be enabled on Steam
13 ADD_DEFINITIONS(-DRZ_USE_STEAM)
15 ELSEIF(WITH_RYZOM_PATCH)
16 ADD_DEFINITIONS(-DRZ_USE_PATCH)
18 IF(WITH_RYZOM_CUSTOM_PATCH_SERVER)
19 ADD_DEFINITIONS(-DRZ_USE_CUSTOM_PATCH_SERVER)
23 FILE(GLOB CFG ../*.cfg)
24 FILE(GLOB SRC *.cpp *.h motion/*.cpp motion/*.h client.rc *.manifest)
25 FILE(GLOB SRC_INTERFACE interface_v3/*.h interface_v3/*.cpp)
26 FILE(GLOB SRC_MODE motion/modes/*.cpp motion/modes/*.h)
27 FILE(GLOB SRC_R2 r2/*.h r2/*.cpp r2/dmc/*.h r2/dmc/*.cpp)
29 # Filter out the source files not actually compiled.
31 ${CMAKE_CURRENT_SOURCE_DIR}/animated_scene_object.cpp
32 ${CMAKE_CURRENT_SOURCE_DIR}/animated_scene_object.h
33 ${CMAKE_CURRENT_SOURCE_DIR}/animation_fx_sheet.h
34 ${CMAKE_CURRENT_SOURCE_DIR}/animation_fx_sheet.cpp
35 ${CMAKE_CURRENT_SOURCE_DIR}/3d_notes.cpp
36 ${CMAKE_CURRENT_SOURCE_DIR}/3d_notes.h
37 ${CMAKE_CURRENT_SOURCE_DIR}/rosace_functions.cpp
38 ${CMAKE_CURRENT_SOURCE_DIR}/rosace_functions.h
39 ${CMAKE_CURRENT_SOURCE_DIR}/scene_parser.cpp
40 ${CMAKE_CURRENT_SOURCE_DIR}/scene_parser.h)
41 LIST(REMOVE_ITEM SRC_MODE
42 ${CMAKE_CURRENT_SOURCE_DIR}/motion/modes/free_head.cpp
43 ${CMAKE_CURRENT_SOURCE_DIR}/motion/modes/free_head.h)
44 LIST(REMOVE_ITEM SRC_INTERFACE
45 ${CMAKE_CURRENT_SOURCE_DIR}/interface_v3/lua_dll.cpp
46 ${CMAKE_CURRENT_SOURCE_DIR}/interface_v3/lua_dll.h
47 ${CMAKE_CURRENT_SOURCE_DIR}/interface_v3/view_bitmap_progress.cpp
48 ${CMAKE_CURRENT_SOURCE_DIR}/interface_v3/view_bitmap_progress.h)
50 SOURCE_GROUP("" FILES ${SRC})
51 SOURCE_GROUP("cfg" FILES ${CFG})
52 SOURCE_GROUP("interface_v3" FILES ${SRC_INTERFACE})
53 SOURCE_GROUP("mode" FILES ${SRC_MODE})
54 SOURCE_GROUP("r2" FILES ${SRC_R2})
56 # on Mac, create a .App Bundle
58 # We could force another build version for the bundle
60 SET(RYZOM_BUILD ${RYZOM_VERSION_SHORT})
63 SET(MACOSX_BUNDLE_INFO_STRING "Ryzom")
64 SET(MACOSX_BUNDLE_ICON_FILE "ryzom.icns")
65 SET(MACOSX_BUNDLE_GUI_IDENTIFIER "com.winchgate.Ryzom")
66 SET(MACOSX_BUNDLE_LONG_VERSION_STRING ${RYZOM_VERSION})
67 SET(MACOSX_BUNDLE_BUNDLE_NAME "Ryzom")
68 SET(MACOSX_BUNDLE_SHORT_VERSION_STRING ${RYZOM_VERSION_SHORT})
69 SET(MACOSX_BUNDLE_BUNDLE_VERSION ${RYZOM_BUILD})
70 SET(MACOSX_BUNDLE_COPYRIGHT ${COPYRIGHT})
71 SET(RYZOM_OUTPUT_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${MACOSX_BUNDLE_BUNDLE_NAME}.app)
72 SET(RYZOM_CONTENTS_DIR ${RYZOM_OUTPUT_DIR}/Contents)
73 SET(RYZOM_RESOURCES_DIR ${RYZOM_CONTENTS_DIR}/Resources)
74 SET(MAC_RESOURCES_DIR ${CMAKE_SOURCE_DIR}/ryzom/client/macosx)
77 ADD_EXECUTABLE(ryzom_client WIN32 MACOSX_BUNDLE ${SRC} ${SRC_INTERFACE} ${SRC_MODE} ${SRC_R2})
80 SET_TARGET_PROPERTIES(ryzom_client PROPERTIES OUTPUT_NAME ${MACOSX_BUNDLE_BUNDLE_NAME})
81 SET_TARGET_PROPERTIES(ryzom_client PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${MAC_RESOURCES_DIR}/Info.plist)
82 ADD_CUSTOM_COMMAND(TARGET ryzom_client PRE_BUILD COMMAND mkdir -p ${RYZOM_RESOURCES_DIR})
83 ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -p ${MAC_RESOURCES_DIR}/PkgInfo ${RYZOM_CONTENTS_DIR})
84 ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -p ${MAC_RESOURCES_DIR}/ryzom.icns ${RYZOM_RESOURCES_DIR})
85 #ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -p ${CMAKE_SOURCE_DIR}/ryzom/client/client_default.cfg ${RYZOM_RESOURCES_DIR})
87 # remove any present installscript_osx.vdf before signing
88 ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND rm -f ${RYZOM_OUTPUT_DIR}/installscript_osx.vdf)
91 ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -RpX ${RYZOM_DATA_DIR} ${RYZOM_RESOURCES_DIR})
94 IF(WITH_RYZOM_SANDBOX)
95 SET(ENTITLEMENTS --entitlements ${MAC_RESOURCES_DIR}/ryzom.entitlements)
100 IF(TARGET crash_report)
101 ADD_DEPENDENCIES(ryzom_client crash_report)
103 # copy crash_report to bundle
104 ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp -p ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/crash_report ${RYZOM_CONTENTS_DIR}/MacOS/CrashReport)
106 IF(CODESIGN_ALLOCATE AND APPLE_CERTIFICATE)
107 ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign ${ENTITLEMENTS} -fs "${APPLE_CERTIFICATE}" "${RYZOM_CONTENTS_DIR}/MacOS/CrashReport" COMMENT "Signing CrashReport executable...")
111 IF(TARGET ryzom_client_patcher)
112 ADD_DEPENDENCIES(ryzom_client ryzom_client_patcher)
114 # copy ryzom_client_patcher to bundle
115 ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp -p ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ryzom_client_patcher ${RYZOM_CONTENTS_DIR}/MacOS/RyzomClientPatcher)
117 IF(CODESIGN_ALLOCATE AND APPLE_CERTIFICATE)
118 ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign ${ENTITLEMENTS} -fs "${APPLE_CERTIFICATE}" "${RYZOM_CONTENTS_DIR}/MacOS/RyzomClientPatcher" COMMENT "Signing RyzomClientPatcher executable...")
122 IF(TARGET ryzom_configuration_qt)
123 ADD_DEPENDENCIES(ryzom_client ryzom_configuration_qt)
125 # copy ryzom_configuration_qt to bundle
126 ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp -p ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ryzom_configuration_qt ${RYZOM_CONTENTS_DIR}/MacOS/RyzomConfiguration)
128 IF(CODESIGN_ALLOCATE AND APPLE_CERTIFICATE)
129 ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign ${ENTITLEMENTS} -fs "${APPLE_CERTIFICATE}" "${RYZOM_CONTENTS_DIR}/MacOS/RyzomConfiguration" COMMENT "Signing RyzomConfiguration executable...")
133 IF(WITH_RYZOM_STEAM AND STEAM_RUNTIME)
134 ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp -p ${STEAM_RUNTIME} ${RYZOM_CONTENTS_DIR}/MacOS)
136 IF(CODESIGN_ALLOCATE AND APPLE_CERTIFICATE)
137 ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --no-strict -fs "${APPLE_CERTIFICATE}" "${RYZOM_CONTENTS_DIR}/MacOS/${STEAM_RUNTIMENAME}" COMMENT "Signing Steam client runtime...")
141 IF(CODESIGN_ALLOCATE AND APPLE_CERTIFICATE)
142 ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign ${ENTITLEMENTS} -fs "${APPLE_CERTIFICATE}" "${RYZOM_OUTPUT_DIR}" COMMENT "Signing Ryzom bundle...")
147 ${CMAKE_CURRENT_SOURCE_DIR}
148 ${LIBXML2_INCLUDE_DIR}
150 ${LUABIND_INCLUDE_DIR}
153 ${OPENSSL_INCLUDE_DIR}
156 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/nel/3rdparty)
159 INCLUDE_DIRECTORIES(${STEAM_INCLUDE_DIRS})
162 TARGET_LINK_LIBRARIES(ryzom_client
180 IF(NOT APPLE AND NOT WIN32)
181 TARGET_LINK_LIBRARIES(ryzom_client ${X11_LIBRARIES})
185 TARGET_LINK_LIBRARIES(ryzom_client ${FOUNDATION_FRAMEWORK})
188 ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${CURL_DEFINITIONS} ${LUABIND_DEFINITIONS})
190 NL_DEFAULT_PROPS(ryzom_client "Ryzom, Client: Ryzom Client")
191 NL_ADD_RUNTIME_FLAGS(ryzom_client)
194 NL_ADD_LIB_SUFFIX(ryzom_client)
197 SET_TARGET_PROPERTIES(ryzom_client PROPERTIES DEBUG_POSTFIX "_dev_d" RELEASE_POSTFIX "_dev_r")
199 SET_TARGET_PROPERTIES(ryzom_client PROPERTIES DEBUG_POSTFIX "_dev" RELEASE_POSTFIX "_dev")
203 IF(WITH_RYZOM_CLIENT_UAC)
204 IF(CMAKE_GENERATOR MATCHES "Visual Studio")
205 SET_PROPERTY(TARGET ryzom_client PROPERTY LINK_FLAGS_RELEASE "/level='requireAdministrator'")
206 ELSEIF(CMAKE_GENERATOR MATCHES "NMake Makefiles")
207 SET_PROPERTY(TARGET ryzom_client PROPERTY LINK_FLAGS_RELEASE "/MANIFESTUAC:\"level='requireAdministrator' uiAccess='false'\"")
211 IF(WITH_PCH AND (NOT MINGW OR NOT WITH_SYMBOLS))
212 ADD_NATIVE_PRECOMPILED_HEADER(ryzom_client ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp)
215 INSTALL(TARGETS ryzom_client RUNTIME DESTINATION ${RYZOM_GAMES_PREFIX} COMPONENT client BUNDLE DESTINATION /Applications)