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.

FindThirdPartyGSL.cmake 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # ---------------------------------
  2. # Finds GSL toolkit
  3. #
  4. # Sets GSL_FOUND
  5. # Sets GSL_LIBRARIES
  6. # Sets GSL_LIBRARY_DIRS
  7. # Sets GSL_LDFLAGS
  8. # Sets GSL_LDFLAGS_OTHERS
  9. # Sets GSL_INCLUDE_DIRS
  10. # Sets GSL_CFLAGS
  11. # Sets GSL_CFLAGS_OTHERS
  12. #
  13. # Adds library to target
  14. # Adds include path
  15. # ---------------------------------
  16. INCLUDE("FindThirdPartyPkgConfig")
  17. pkg_check_modules(GSL gsl)
  18. IF(GSL_FOUND)
  19. debug_message(" Found gsl...")
  20. INCLUDE_DIRECTORIES(${GSL_INCLUDE_DIRS})
  21. ADD_DEFINITIONS(${GSL_CFLAGS})
  22. ADD_DEFINITIONS(${GSL_CFLAGS_OTHERS})
  23. # LINK_DIRECTORIES(${GSL_LIBRARY_DIRS})
  24. FOREACH(GSL_LIB ${GSL_LIBRARIES})
  25. SET(GSL_LIB1 "GSL_LIB1-NOTFOUND")
  26. FIND_LIBRARY(GSL_LIB1 NAMES ${GSL_LIB} PATHS ${GSL_LIBRARY_DIRS} ${GSL_LIBDIR} NO_DEFAULT_PATH)
  27. FIND_LIBRARY(GSL_LIB1 NAMES ${GSL_LIB})
  28. IF(GSL_LIB1)
  29. debug_message(" [ OK ] Third party lib ${GSL_LIB1}")
  30. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${GSL_LIB1})
  31. ELSE(GSL_LIB1)
  32. MESSAGE(WARNING " [FAILED] Third party lib ${GSL_LIB}")
  33. ENDIF(GSL_LIB1)
  34. ENDFOREACH(GSL_LIB)
  35. ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyGSL)
  36. ELSE(GSL_FOUND)
  37. MESSAGE(WARNING " FAILED to find gsl...")
  38. ENDIF(GSL_FOUND)