Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F623802
CMakeLists.txt
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
CMakeLists.txt
View Options
cmake_minimum_required(VERSION 2.8.12)
# Projet name
project("Witch_Blast")
# Detect compiler
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(USING_GCC TRUE)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(USING_CLANG TRUE)
endif()
# For GCC and Clang, enable C++11 support and add some other flags
if(USING_GCC OR USING_CLANG)
add_compile_options(-std=c++11 -pedantic -Wall)
endif()
# Compilation options
option(ONLINE_MODE "Enable online mode, which requires src/OnlineScoring.h" OFF)
if(ONLINE_MODE)
add_compile_options(-DONLINE_MODE)
endif()
include_directories(.)
file(
GLOB_RECURSE
source_files
src/*
)
add_executable(
"Witch_Blast"
MACOSX_BUNDLE
${source_files}
)
set_target_properties(Witch_Blast PROPERTIES
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}
)
if(APPLE)
set_target_properties(Witch_Blast PROPERTIES
MACOSX_RPATH 1
BUILD_WITH_INSTALL_RPATH 1
INSTALL_RPATH "@loader_path/../Frameworks")
set(EXTRA_LIBRARIES "-framework CoreFoundation")
endif()
# Detect and add SFML
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH})
find_package(SFML 2.2 REQUIRED system window graphics audio)
target_link_libraries(Witch_Blast ${SFML_LIBRARIES} ${EXTRA_LIBRARIES})
include_directories(${SFML_INCLUDE_DIR})
Message(${SFML_LIBRARIES})
if(APPLE)
install(
DIRECTORY Witch_Blast.app
DESTINATION "."
USE_SOURCE_PERMISSIONS)
install(
DIRECTORY
${CMAKE_SOURCE_DIR}/data
${CMAKE_SOURCE_DIR}/media
DESTINATION Witch_Blast.app/Contents/Resources)
# copy SFML frameworks into app bundle for Mac OS X
set(LIBS SFML sfml-system sfml-window sfml-graphics sfml-audio)
foreach(LIB ${LIBS})
install(DIRECTORY /Library/Frameworks/${LIB}.framework
DESTINATION Witch_Blast.app/Contents/Frameworks)
endforeach()
install(FILES
${CMAKE_SOURCE_DIR}/COPYING.txt
${CMAKE_SOURCE_DIR}/readme.txt
DESTINATION ".")
endif()
# Packaging
SET(CPACK_PACKAGE_VERSION "0.7")
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "7")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
SET(CPACK_PACKAGE_EXECUTABLES "Witch_Blast;Witch Blast")
if(APPLE)
set(CPACK_GENERATOR "DragNDrop")
set(CPACK_DMG_FORMAT "UDBZ")
set(CPACK_DMG_VOLUME_NAME "Witch Blast")
set(CPACK_SYSTEM_NAME "OSX")
# TODO: CPACK_PACKAGE_ICON
# TODO: CPACK_DMG_BACKGROUND_IMAGE
# TODO: CPACK_DMG_DS_STORE
endif()
include(CPack)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 14, 9:38 PM (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
112535
Default Alt Text
CMakeLists.txt (2 KB)
Attached To
Mode
R78 witchblast
Attached
Detach File
Event Timeline