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} )