2
0

FindConfigCpp.cmake 707 B

12345678910111213141516171819202122232425262728
  1. # CONFIGCPP_FOUND
  2. # CONFIGCPP_LIBRARIES
  3. # CONFIGCPP_LIBRARY_DIRS
  4. # CONFIGCPP_LDFLAGS
  5. # CONFIGCPP_INCLUDE_DIRS
  6. # CONFIGCPP_CMAKE_DIRS
  7. # CONFIGCPP_CFLAGS
  8. if (NOT KS_PLAT_WIN)
  9. include(FindPkgConfig)
  10. if (NOT PKG_CONFIG_FOUND)
  11. message("Failed to locate pkg-config" FATAL)
  12. endif()
  13. pkg_check_modules(CONFIGCPP libconfig++ REQUIRED)
  14. link_directories(${CONFIGCPP_LIBRARY_DIRS})
  15. else()
  16. # set(NOT TARGET libconfig++)
  17. # message(FATAL_ERROR "Failed to locate libconfig++ target")
  18. # endif()
  19. set(CONFIGCPP_LIBRARIES "libconfig++")
  20. get_target_property(CONFIGCPP_INCLUDE_DIRS libconfig++ SOURCE_DIR)
  21. set(CONFIGCPP_INCLUDE_DIRS ${CONFIGCPP_INCLUDE_DIRS})
  22. set(CONFIGCPP_CFLAGS -DLIBCONFIGXX_STATIC=1)
  23. endif()