Rosegarden – music editor and MIDI/audio sequencer
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 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. #################################################
  2. #
  3. # (C) 2011 Timothy Pearson
  4. # kb9vqf (AT) pearsoncomputing.net
  5. #
  6. # Improvements and feedback are welcome
  7. #
  8. # This file is released under GPL >= 2
  9. #
  10. #################################################
  11. cmake_minimum_required( VERSION 2.8 )
  12. ##### general package setup #####################
  13. # The name of our project is "ROSEGARDEN". CMakeLists files in this project can
  14. # refer to the root source directory of the project as ${ROSEGARDEN_SOURCE_DIR}
  15. # and to the root binary directory of the project as ${ROSEGARDEN_BINARY_DIR}
  16. PROJECT(ROSEGARDEN)
  17. ##### include essential cmake modules ###########
  18. include( CheckCXXSourceCompiles )
  19. include( CheckFunctionExists )
  20. include( CheckIncludeFileCXX )
  21. include( CheckLibraryExists )
  22. include( CheckStructHasMember )
  23. include( CheckSymbolExists )
  24. include( CheckTypeSize )
  25. include( FindPkgConfig )
  26. ##### set up versioning #########################
  27. # Mark as advanced
  28. MARK_AS_ADVANCED(EXECUTABLE_OUTPUT_PATH
  29. LIBRARY_OUTPUT_PATH
  30. CMAKE_BACKWARDS_COMPATIBILITY)
  31. # Rosegarden version string
  32. SET (VERSION_MAJOR "1")
  33. SET (VERSION_MINOR "7")
  34. SET (VERSION_PATCH "0")
  35. # comment out the next line for a public release
  36. #SET (VERSION_SUFFIX "svn")
  37. SET (VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
  38. IF(VERSION_SUFFIX)
  39. SET (VERSION "${VERSION}-${VERSION_SUFFIX}")
  40. ENDIF(VERSION_SUFFIX)
  41. ADD_DEFINITIONS(-D'VERSION="${VERSION}"')
  42. ##### include our cmake modules #################
  43. set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
  44. include( TDEMacros )
  45. ##### setup install paths #######################
  46. include( TDESetupPaths )
  47. tde_setup_paths( )
  48. ##### user requested modules ####################
  49. option( BUILD_ALL "Build all" OFF )
  50. option( BUILD_DOC "Build doc" ${BUILD_ALL} )
  51. option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )
  52. option( WANT_DEBUG "Include debug support" OFF )
  53. option( WANT_FULLDBG "Full debug support (BIG executables!)" OFF )
  54. option( WANT_SOUND "Include Sound support" ${BUILD_ALL} )
  55. option( WANT_JACK "Include Jack (Jack Audio Connection Kit) support" ${BUILD_ALL} )
  56. option( WANT_DSSI "Include DSSI support" ${BUILD_ALL} )
  57. option( WANT_LIRC "Include LIRC (Linux Infrared Remote Control) support" OFF )
  58. option( WANT_PCH "Use precompiled headers" OFF )
  59. option( WANT_TEST "Perform unit tests" OFF )
  60. IF(WANT_TEST)
  61. ENABLE_TESTING()
  62. ENDIF(WANT_TEST)
  63. IF(NOT WANT_SOUND)
  64. SET(WANT_JACK OFF)
  65. SET(WANT_DSSI OFF)
  66. ADD_DEFINITIONS(-DNO_SOUND)
  67. ENDIF(NOT WANT_SOUND)
  68. ##### configure checks ##########################
  69. include( ConfigureChecks.cmake )
  70. ###### global compiler settings #################
  71. add_definitions(
  72. -DHAVE_CONFIG_H
  73. )
  74. set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
  75. set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
  76. set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" )
  77. ##### source directories ########################
  78. add_subdirectory( src )
  79. add_subdirectory( data )
  80. tde_conditional_add_subdirectory( BUILD_DOC doc )
  81. tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po )
  82. ##### write configure files #####################
  83. configure_file( config.h.cmake config.h @ONLY )
  84. # create and install the version file
  85. FILE(WRITE version.txt "${VERSION}\n")
  86. INSTALL( FILES version.txt DESTINATION ${DATA_INSTALL_DIR}/rosegarden )
  87. # configure the RPM spec
  88. CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/rosegarden.spec.in" "${CMAKE_SOURCE_DIR}/rosegarden.spec" IMMEDIATE @ONLY)