/CMakeLists.txt

https://bitbucket.org/jrussellsmyth/qntools · CMake · 62 lines · 43 code · 10 blank · 9 comment · 6 complexity · 28627498c7f8b640eb2d48696186ae5d MD5 · raw file

  1. project(qnTools)
  2. set(VERSION "0.0.1-SNAPSHOT")
  3. # Project Options
  4. option(build-gtk-gui "Build GTK GUI application" OFF)
  5. option(BUILD_TESTS "Build and execute unit tests" OFF)
  6. #Basic CMake Settings
  7. set(CPACK_PACKAGE_VERSION 0.0.1)
  8. set(CTEST_OUTPUT_ON_FAILURE)
  9. cmake_minimum_required (VERSION 2.6)
  10. #Progject global Always options
  11. set(CMAKE_CXX_FLAGS "-std=c++0x")
  12. find_package(PkgConfig)
  13. pkg_check_modules(JSONCPP REQUIRED jsoncpp)
  14. #Include and Library Paths (unconditional)
  15. link_directories(${JSONCPP_LIBRARY_DIRS} ${ALSA_LIBRARY_DIRS})
  16. include_directories(${JSONCPP_INCLUDE_DIRS} ${ALSA_INCLUDE_DIRS})
  17. #Platform Specific Options
  18. #elseif not used as it didnt seem to work
  19. if(WIN32)
  20. # Do windows specific includes
  21. add_definitions(-D__WINDOWS_MM__ -D__WINDOWS_KS__ )
  22. endif(WIN32)
  23. if(APPLE)
  24. add_definitions(-D__MACOSX_CORE__)
  25. endif(APPLE)
  26. if(UNIX)
  27. find_package(ALSA REQUIRED)
  28. add_definitions(-D__LINUX_ALSA__)
  29. link_directories(${ALSA_LIBRARY_DIRS})
  30. include_directories(${ALSA_INCLUDE_DIRS})
  31. endif(UNIX)
  32. add_subdirectory(qn_update)
  33. add_subdirectory(presetmanager)
  34. if(build-gtk-gui)
  35. pkg_check_modules(GTKMM gtkmm-3.0)
  36. link_directories(${GTKMM_LIBRARY_DIRS})
  37. include_directories(${GTKMM_INCLUDE_DIRS})
  38. add_subdirectory(gtkgui)
  39. endif(build-gtk-gui)
  40. #Testing
  41. if (build-tests)
  42. enable_testing()
  43. add_subdirectory(gtest-1.6.0)
  44. endif(build-tests)
  45. #Packaging
  46. INCLUDE (InstallRequiredSystemLibraries)
  47. set(CPACK_GENERATOR "DEB")
  48. SET(CPACK_PACKAGE_NAME "qntools")
  49. SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Tools for working with KMI QuNeo")
  50. SET(CPACK_PACKAGE_CONTACT "jrussell.smyth@gmail.com")
  51. SET(CPACK_DEBIAN_PACKAGE_DEPENDS "alsa, jsoncpp")
  52. INCLUDE(CPack)