aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Müller <muemart@users.noreply.github.com>2017-05-31 10:42:25 +0200
committerMartin Müller <muemart@users.noreply.github.com>2017-05-31 10:50:33 +0200
commited826d84124f52bc8625027ea672a3bd4e5d7d67 (patch)
tree33d3bdbd328d9f8a50da63b9652438e867dcd635
parent683d8a8820680fc017d0faef08bac490f68e781e (diff)
downloadvcpkg-ed826d84124f52bc8625027ea672a3bd4e5d7d67.tar.gz
vcpkg-ed826d84124f52bc8625027ea672a3bd4e5d7d67.zip
Fix GSL port so that CMake can find it
- Remove lib prefix from library - Generate separate library for the cblas part
-rw-r--r--ports/gsl/CMakeLists.txt25
1 files changed, 18 insertions, 7 deletions
diff --git a/ports/gsl/CMakeLists.txt b/ports/gsl/CMakeLists.txt
index 704542035..c6121e6cd 100644
--- a/ports/gsl/CMakeLists.txt
+++ b/ports/gsl/CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.8)
-project(libgsl C)
+project(gsl C)
option(INSTALL_HEADERS "Install public header files" ON)
@@ -27,10 +27,15 @@ function(extract_sources SUBFOLDER ALLSOURCES)
endfunction(extract_sources)
set(SOURCES)
+set(CBLAS_SOURCES)
extract_from_makefile("SUBDIRS = ([^\n]*)" FOLDERS "./Makefile.am")
extract_sources("." SOURCES)
foreach(DIR IN LISTS FOLDERS)
- extract_sources("${DIR}" SOURCES)
+ if("${DIR}" STREQUAL "cblas")
+ extract_sources("${DIR}" CBLAS_SOURCES)
+ else()
+ extract_sources("${DIR}" SOURCES)
+ endif()
endforeach()
file(READ gsl_types.h GSLTYPES_H)
@@ -43,13 +48,19 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gsl_types.h "${GSLTYPES_H}")
file(GLOB_RECURSE PUBLIC_HEADERS gsl*.h)
list(APPEND PUBLIC_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/gsl_types.h)
-add_library(libgsl ${SOURCES})
-set_target_properties(libgsl PROPERTIES DEFINE_SYMBOL DLL_EXPORT WINDOWS_EXPORT_ALL_SYMBOLS ON)
+add_library(gslcblas ${CBLAS_SOURCES})
+set_target_properties(gslcblas PROPERTIES DEFINE_SYMBOL DLL_EXPORT WINDOWS_EXPORT_ALL_SYMBOLS ON)
+
+add_library(gsl ${SOURCES})
+set_target_properties(gsl PROPERTIES DEFINE_SYMBOL DLL_EXPORT WINDOWS_EXPORT_ALL_SYMBOLS ON)
+target_link_libraries(gsl PUBLIC gslcblas)
+
if(INSTALL_HEADERS)
- set_target_properties(libgsl PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}")
+ set_target_properties(gsl PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}")
endif()
-target_include_directories(libgsl PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
+target_include_directories(gslcblas PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
+target_include_directories(gsl PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
# For the build, we need to copy all headers to the gsl directory
file(COPY ${PUBLIC_HEADERS} DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/gsl")
@@ -58,7 +69,7 @@ if(INSTALL_HEADERS)
set(TARGET_INSTALL_OPTIONS PUBLIC_HEADER DESTINATION include/gsl)
endif()
-install(TARGETS libgsl
+install(TARGETS gsl gslcblas
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib