CMakeLists.txt 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ###########################################################################
  2. #
  3. # Library: CTK
  4. #
  5. # Copyright (c) Kitware Inc.
  6. #
  7. # Licensed under the Apache License, Version 2.0 (the "License");
  8. # you may not use this file except in compliance with the License.
  9. # You may obtain a copy of the License at
  10. #
  11. # http://www.apache.org/licenses/LICENSE-2.0.txt
  12. #
  13. # Unless required by applicable law or agreed to in writing, software
  14. # distributed under the License is distributed on an "AS IS" BASIS,
  15. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. # See the License for the specific language governing permissions and
  17. # limitations under the License.
  18. #
  19. ###########################################################################
  20. cmake_minimum_required(VERSION 2.8)
  21. foreach(policy CMP0003)
  22. if(POLICY ${policy})
  23. cmake_policy(SET ${policy} NEW)
  24. endif()
  25. endforeach()
  26. project(DGraph)
  27. set(CTK_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../)
  28. set(QT_DONT_USE_QTGUI TRUE)
  29. find_package(Qt4 4.6 REQUIRED)
  30. include(${QT_USE_FILE})
  31. include_directories(
  32. ${CMAKE_CURRENT_SOURCE_DIR}
  33. ${CMAKE_CURRENT_BINARY_DIR}
  34. ${CTK_SOURCE_DIR}/Libs/Core
  35. )
  36. # Do not export symbol in ctkDependencyGraph class
  37. add_definitions(-DNO_SYMBOL_EXPORT)
  38. # Configure CTKCoreExport.h
  39. set(MY_EXPORT_HEADER_PREFIX CTKCore)
  40. set(MY_LIBRARY_EXPORT_DIRECTIVE CTK_CORE_EXPORT)
  41. configure_file(
  42. ${CTK_SOURCE_DIR}/Libs/ctkExport.h.in
  43. ${CMAKE_CURRENT_BINARY_DIR}/${MY_EXPORT_HEADER_PREFIX}Export.h
  44. )
  45. # Add excutable
  46. add_executable(${PROJECT_NAME}
  47. DGraph.cpp
  48. ${CTK_SOURCE_DIR}/Libs/Core/ctkDependencyGraph.h
  49. ${CTK_SOURCE_DIR}/Libs/Core/ctkDependencyGraph.cpp)
  50. target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES} )