Open Source Tomb Raider Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. cmake_minimum_required (VERSION 2.8)
  2. project (OpenRaider)
  3. # Version Number
  4. set (OpenRaider_VERSION_MAJOR 0)
  5. set (OpenRaider_VERSION_MINOR 1)
  6. set (OpenRaider_VERSION_MICRO 2)
  7. # Build Host
  8. set (OpenRaider_BUILD_HOST ${CMAKE_HOST_SYSTEM})
  9. # Configuration Header file
  10. configure_file (
  11. "${PROJECT_SOURCE_DIR}/include/Config.h.in"
  12. "${PROJECT_BINARY_DIR}/Config.h"
  13. )
  14. include_directories ("${PROJECT_BINARY_DIR}")
  15. # Default to Debug build
  16. set (CMAKE_BUILD_TYPE "Debug")
  17. # Add subdirectories
  18. add_subdirectory (src)
  19. add_subdirectory (test)
  20. #################################################################
  21. # Preparing the bundle on install
  22. # http://www.cmake.org/Wiki/BundleUtilitiesExample
  23. # Why does it even work? O.o
  24. if (APPLE)
  25. set (plugin_dest_dir OpenRaider.app/Contents/MacOS)
  26. set (APPS "${PROJECT_BINARY_DIR}/src/OpenRaider.app")
  27. set (DIRS ${QT_LIBRARY_DIRS})
  28. install (CODE "
  29. file(GLOB_RECURSE PLUGINS
  30. \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/plugins/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
  31. include(BundleUtilities)
  32. fixup_bundle(\"${APPS}\" \"\${PLUGINS}\" \"${DIRS}\")
  33. " COMPONENT Runtime
  34. )
  35. endif (APPLE)
  36. #################################################################
  37. # Target for running cppcheck
  38. set (CHECK_STD "--std=c++11" "--std=posix")
  39. set (CHECK_FLAGS "--quiet" "--force")
  40. set (CHECK_NORMAL "--enable=information,warning,performance,portability")
  41. set (CHECK_FULL "--enable=all")
  42. set (CHECK_CONFIG "--check-config")
  43. add_custom_target (check echo "Running cppcheck..."
  44. COMMAND cppcheck ${CHECK_FLAGS} "-I${PROJECT_SOURCE_DIR}/include" ${CHECK_STD} ${CHECK_NORMAL} ${PROJECT_SOURCE_DIR}
  45. )
  46. add_custom_target (checkFull echo "Running full cppcheck..."
  47. COMMAND cppcheck ${CHECK_FLAGS} "-I${PROJECT_SOURCE_DIR}/include" ${CHECK_STD} ${CHECK_FULL} ${PROJECT_SOURCE_DIR}
  48. )
  49. add_custom_target (checkConfig echo "Checking cppcheck config..."
  50. COMMAND cppcheck ${CHECK_FLAGS} "-I${PROJECT_SOURCE_DIR}/include" ${CHECK_CONFIG} ${PROJECT_SOURCE_DIR}
  51. )
  52. #################################################################
  53. #docLocal:
  54. # sed -i '' 's/HAVE_DOT = YES/HAVE_DOT = NO/g' Doxyfile
  55. # doxygen
  56. # cp -R doc/html/* ../apache/
  57. # rm -rf doc
  58. # sed -i '' 's/HAVE_DOT = NO/HAVE_DOT = YES/g' Doxyfile