UnibiliumCMakeLists.txt 1012 B

1234567891011121314151617181920212223242526
  1. cmake_minimum_required(VERSION 2.8.12)
  2. project(unibilium LANGUAGES C)
  3. file(GLOB SRC_FILES ${PROJECT_SOURCE_DIR}/*.c)
  4. add_library(unibilium ${SRC_FILES})
  5. set_target_properties(unibilium PROPERTIES PUBLIC_HEADER ${PROJECT_SOURCE_DIR}/unibilium.h
  6. VERSION "${VERSION_MAJOR}.${VERSION_MINOR}")
  7. if(NOT WIN32)
  8. execute_process(COMMAND "shell ncursesw6-config --terminfo-dirs 2>/dev/null || \
  9. ncurses6-config --terminfo-dirs 2>/dev/null || \
  10. ncursesw5-config --terminfo-dirs 2>/dev/null || \
  11. ncurses5-config --terminfo-dirs 2>/dev/null || \
  12. echo '/etc/terminfo:/lib/terminfo:/usr/share/terminfo:/usr/lib/terminfo:/usr/local/share/terminfo:/usr/local/lib/terminfo'"
  13. OUTPUT_VARIABLE TERMINFO_DIRS)
  14. else()
  15. set(TERMINFO_DIRS "\"\"")
  16. endif()
  17. target_compile_definitions(unibilium PUBLIC TERMINFO_DIRS=${TERMINFO_DIRS})
  18. include(GNUInstallDirs)
  19. install(TARGETS unibilium
  20. PUBLIC_HEADER
  21. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  22. PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})