aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-05-31 23:43:54 -0700
committerGitHub <noreply@github.com>2017-05-31 23:43:54 -0700
commit14e1886d6a58bc384b7ebde0d2d252d32358dfae (patch)
tree687eb7be526fa8f3fe6ae732d7bd4c6aea32b749
parent18f9d17a6b2ff14deba779461bc9aea9c3c4cc98 (diff)
parentf53871c169f274817d2322bdaf6483b997e545bc (diff)
downloadvcpkg-14e1886d6a58bc384b7ebde0d2d252d32358dfae.tar.gz
vcpkg-14e1886d6a58bc384b7ebde0d2d252d32358dfae.zip
Merge pull request #1199 from muemart/gsl-cblas
Fix GSL port so that CMake can find it
-rw-r--r--ports/gsl/CMakeLists.txt25
-rw-r--r--ports/gsl/CONTROL2
2 files changed, 19 insertions, 8 deletions
diff --git a/ports/gsl/CMakeLists.txt b/ports/gsl/CMakeLists.txt
index 704542035..45abb5bd2 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 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
diff --git a/ports/gsl/CONTROL b/ports/gsl/CONTROL
index 8970dca69..a18b341c9 100644
--- a/ports/gsl/CONTROL
+++ b/ports/gsl/CONTROL
@@ -1,3 +1,3 @@
Source: gsl
-Version: 2.3
+Version: 2.3-1
Description: The GNU Scientific Library is a numerical library for C and C++ programmers