CMakeLists.txt 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. include_directories(
  29. ${CMAKE_CURRENT_SOURCE_DIR}
  30. ${CMAKE_CURRENT_BINARY_DIR}
  31. ${CTK_SOURCE_DIR}/Libs/Core
  32. )
  33. # Do not export symbol in ctkDependencyGraph class
  34. add_definitions(-DNO_SYMBOL_EXPORT)
  35. # Configure CTKCoreExport.h
  36. set(MY_EXPORT_HEADER_PREFIX CTKCore)
  37. set(MY_LIBRARY_EXPORT_DIRECTIVE CTK_CORE_EXPORT)
  38. configure_file(
  39. ${CTK_SOURCE_DIR}/Libs/ctkExport.h.in
  40. ${CMAKE_CURRENT_BINARY_DIR}/${MY_EXPORT_HEADER_PREFIX}Export.h
  41. )
  42. # Add excutable
  43. add_executable(${PROJECT_NAME}
  44. DGraph.cpp
  45. ${CTK_SOURCE_DIR}/Libs/Core/ctkDependencyGraph.h
  46. ${CTK_SOURCE_DIR}/Libs/Core/ctkDependencyGraph.cpp)