X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=CMakeLists.txt;h=087eafe333cacaa94e79cd6ab3390dd2943fd073;hb=e08372a2095837a0b951ccb68c3499ef67c1a827;hp=7a1055e20f237cb09e6cf3aa4bd3afe754501201;hpb=dcf6c862ef885a9fe02dddd82cfd8e7228e7cacb;p=lugaru.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a1055e..087eafe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,10 +6,10 @@ cmake_policy(SET CMP0004 OLD) include(FindPkgConfig) include(GNUInstallDirs) -set(SRCDIR "${CMAKE_CURRENT_SOURCE_DIR}/Source") +### Helpers -### Helper +set(SRCDIR "${CMAKE_CURRENT_SOURCE_DIR}/Source") if(UNIX AND NOT APPLE) set(LINUX TRUE) @@ -18,9 +18,12 @@ endif() ### CMake config -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 --std=c++11") -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wno-parentheses -pedantic -g -pg --std=c++11") -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -Wno-parentheses -O2 -std=c++11") +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE RelWithDebInfo) +endif(NOT CMAKE_BUILD_TYPE) +message("CMake build type: ${CMAKE_BUILD_TYPE}") + +set(CMAKE_CXX_FLAGS "-Wall -Wno-parentheses -pedantic --std=c++11 ${CMAKE_CXX_FLAGS}") if(APPLE) set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX") @@ -41,10 +44,16 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") set(LUGARU_SRCS ${SRCDIR}/main.cpp + ${SRCDIR}/Animation/Animation.cpp + ${SRCDIR}/Animation/Joint.cpp + ${SRCDIR}/Animation/Muscle.cpp + ${SRCDIR}/Animation/Skeleton.cpp ${SRCDIR}/Frustum.cpp ${SRCDIR}/Account.cpp + ${SRCDIR}/Campaign.cpp ${SRCDIR}/ConsoleCmds.cpp ${SRCDIR}/Dialog.cpp + ${SRCDIR}/Hotspot.cpp ${SRCDIR}/Game.cpp ${SRCDIR}/GameDraw.cpp ${SRCDIR}/GameInitDispose.cpp @@ -58,7 +67,6 @@ set(LUGARU_SRCS ${SRCDIR}/Person.cpp ${SRCDIR}/private.c ${SRCDIR}/Quaternions.cpp - ${SRCDIR}/Skeleton.cpp ${SRCDIR}/Skybox.cpp ${SRCDIR}/Sprite.cpp ${SRCDIR}/Terrain.cpp @@ -71,17 +79,22 @@ set(LUGARU_SRCS ${SRCDIR}/Input.cpp ${SRCDIR}/Settings.cpp ${SRCDIR}/Stereo.cpp - ${SRCDIR}/Animation.cpp ${SRCDIR}/Sounds.cpp ${SRCDIR}/Awards.cpp ${SRCDIR}/Utils/Folders.cpp ) set(LUGARU_H + ${SRCDIR}/Animation/Animation.h + ${SRCDIR}/Animation/Joint.h + ${SRCDIR}/Animation/Muscle.h + ${SRCDIR}/Animation/Skeleton.h ${SRCDIR}/Frustum.h ${SRCDIR}/Account.h + ${SRCDIR}/Campaign.h ${SRCDIR}/ConsoleCmds.h ${SRCDIR}/Dialog.h + ${SRCDIR}/Hotspot.h ${SRCDIR}/Game.h ${SRCDIR}/Lights.h ${SRCDIR}/Menu.h @@ -91,7 +104,6 @@ set(LUGARU_H ${SRCDIR}/PhysicsMath.h ${SRCDIR}/Quaternions.h ${SRCDIR}/Random.h - ${SRCDIR}/Skeleton.h ${SRCDIR}/Skybox.h ${SRCDIR}/Sprite.h ${SRCDIR}/ImageIO.h @@ -107,7 +119,6 @@ set(LUGARU_H ${SRCDIR}/private.h ${SRCDIR}/Settings.h ${SRCDIR}/Stereo.h - ${SRCDIR}/Animation.h ${SRCDIR}/Sounds.h ${SRCDIR}/Utils/Folders.h ) @@ -224,6 +235,7 @@ endif(APPLE) if(WIN32) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lugaru.exe DESTINATION ${CMAKE_INSTALL_PREFIX}) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/Data DESTINATION ${CMAKE_INSTALL_PREFIX}) if(MINGW) # Based off Mageia/Fedora MinGW toolchain, might not work on other distros or Windows set(LIBGCC_S libgcc_s_sjlj-1.dll) @@ -254,11 +266,12 @@ if(LINUX) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lugaru DESTINATION ${CMAKE_INSTALL_BINDIR}) # Trailing '/' is significant, it installs and _renames_ Data/ as the destination folder install(DIRECTORY ${CMAKE_SOURCE_DIR}/Data/ DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}) - #install(FILES ${CMAKE_SOURCE_DIR}/Dist/lugaru.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/appdata) + install(FILES ${CMAKE_SOURCE_DIR}/Dist/lugaru.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/appdata) install(FILES ${CMAKE_SOURCE_DIR}/Dist/lugaru.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) install(FILES ${CMAKE_SOURCE_DIR}/Dist/lugaru.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps) + install(FILES ${CMAKE_SOURCE_DIR}/Dist/lugaru.6 DESTINATION ${CMAKE_INSTALL_MANDIR}/man6) else(SYSTEM_INSTALL) - message(WARNING "You are installing Lugaru without having enabled the SYSTEM_INSTALL option. It will default to looking for the data in the 'Data' directory next to the binary.") + message("You are building Lugaru without having enabled the SYSTEM_INSTALL option. It will default to looking for the data in the 'Data' directory next to the binary.") install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lugaru DESTINATION ${CMAKE_INSTALL_PREFIX}) install(DIRECTORY ${CMAKE_SOURCE_DIR}/Data DESTINATION ${CMAKE_INSTALL_PREFIX}) endif(SYSTEM_INSTALL) @@ -273,7 +286,9 @@ endif(APPLE) # Documentation -install(FILES ${CMAKE_SOURCE_DIR}/README.md - ${CMAKE_SOURCE_DIR}/COPYING.txt +install(FILES ${CMAKE_SOURCE_DIR}/AUTHORS ${CMAKE_SOURCE_DIR}/CONTENT-LICENSE.txt + ${CMAKE_SOURCE_DIR}/COPYING.txt + ${CMAKE_SOURCE_DIR}/DEVTOOLS.txt + ${CMAKE_SOURCE_DIR}/README.md DESTINATION ${LUGARU_DOCDIR})