CMakeLists.txt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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)
  47. TARGET_LINK_LIBRARIES(${PROJECT_NAME})