identiconpp is a library to generate identicons for C++ and C.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. cmake_minimum_required (VERSION 3.2)
  2. project(identiconpp
  3. VERSION 0.5.0
  4. LANGUAGES CXX
  5. )
  6. include(GNUInstallDirs)
  7. find_package(PkgConfig REQUIRED)
  8. pkg_check_modules(MAGICPP REQUIRED Magick++)
  9. set(CMAKE_CXX_STANDARD 14)
  10. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  11. set(CMAKE_CXX_EXTENSIONS OFF)
  12. string(REPLACE ";" " " MAGICPP_CFLAGS_STRING "${MAGICPP_CFLAGS}")
  13. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MAGICPP_CFLAGS_STRING}")
  14. set(CMAKE_CXX_FLAGS_DEBUG
  15. "${CMAKE_CXX_FLAGS_DEBUG} -Wall -pedantic -Wextra -g -Og -fno-omit-frame-pointer")
  16. if(CMAKE_BUILD_TYPE STREQUAL "Debug")
  17. add_definitions(-DDEBUG=1)
  18. endif()
  19. include_directories(${PROJECT_SOURCE_DIR}/src)
  20. include_directories(${PROJECT_BINARY_DIR})
  21. include_directories(${MAGICPP_INCLUDE_DIRS})
  22. link_directories(${MAGICPP_LIBRARY_DIRS})
  23. file(GLOB sources src/*.cpp)
  24. add_library(${CMAKE_PROJECT_NAME} SHARED "${sources}")
  25. set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES
  26. VERSION ${PROJECT_VERSION}
  27. SOVERSION ${${CMAKE_PROJECT_NAME}_VERSION_MAJOR})
  28. target_link_libraries(${CMAKE_PROJECT_NAME} "${MAGICPP_LDFLAGS}")
  29. add_executable(example "example.cpp")
  30. target_link_libraries(example ${CMAKE_PROJECT_NAME})
  31. install(TARGETS ${CMAKE_PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
  32. install(FILES src/${CMAKE_PROJECT_NAME}.hpp DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
  33. install(FILES src/${CMAKE_PROJECT_NAME}_c.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
  34. install(FILES README.md DESTINATION ${CMAKE_INSTALL_DOCDIR})
  35. include(packages.CMakeLists.txt)
  36. include(tests.CMakeLists.txt)