diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2018-03-07 11:56:21 -0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2018-03-07 11:56:21 -0800 |
| commit | a759caf15e031744e99e9718633fcc8d9a60b077 (patch) | |
| tree | 74b6f53f512d12b2f34b237705768ecc60335380 | |
| parent | 7221344fd89a46b2bb4eb300f0633c76823bee55 (diff) | |
| download | vcpkg-a759caf15e031744e99e9718633fcc8d9a60b077.tar.gz vcpkg-a759caf15e031744e99e9718633fcc8d9a60b077.zip | |
[gsl] Fix finding release libs in debug configurations. Fixes #2982.
| -rw-r--r-- | ports/gsl/CMakeLists.txt | 7 | ||||
| -rw-r--r-- | ports/gsl/CONTROL | 2 | ||||
| -rw-r--r-- | ports/gsl/portfile.cmake | 2 | ||||
| -rw-r--r-- | ports/gsl/usage | 4 | ||||
| -rw-r--r-- | scripts/buildsystems/vcpkg.cmake | 12 |
5 files changed, 22 insertions, 5 deletions
diff --git a/ports/gsl/CMakeLists.txt b/ports/gsl/CMakeLists.txt index eb38a4431..0027fe291 100644 --- a/ports/gsl/CMakeLists.txt +++ b/ports/gsl/CMakeLists.txt @@ -63,10 +63,11 @@ target_link_libraries(gsl PUBLIC gslcblas) if(INSTALL_HEADERS) set_target_properties(gsl PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") endif() -target_include_directories(gslcblas PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) -target_include_directories(gsl PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(gslcblas PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(gsl PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${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") +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/gsl) +file(COPY ${PUBLIC_HEADERS} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/gsl") set(TARGET_INSTALL_OPTIONS) if(INSTALL_HEADERS) diff --git a/ports/gsl/CONTROL b/ports/gsl/CONTROL index b6dc858dc..f02ecc2ee 100644 --- a/ports/gsl/CONTROL +++ b/ports/gsl/CONTROL @@ -1,3 +1,3 @@ Source: gsl -Version: 2.4-2 +Version: 2.4-3 Description: The GNU Scientific Library is a numerical library for C and C++ programmers diff --git a/ports/gsl/portfile.cmake b/ports/gsl/portfile.cmake index 519fe4708..12c0526bc 100644 --- a/ports/gsl/portfile.cmake +++ b/ports/gsl/portfile.cmake @@ -27,7 +27,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/gsl) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/gsl) file(RENAME ${CURRENT_PACKAGES_DIR}/share/gsl/COPYING ${CURRENT_PACKAGES_DIR}/share/gsl/copyright) vcpkg_copy_pdbs() diff --git a/ports/gsl/usage b/ports/gsl/usage new file mode 100644 index 000000000..f1ae92436 --- /dev/null +++ b/ports/gsl/usage @@ -0,0 +1,4 @@ +The package gsl is compatible with built-in CMake targets:
+
+ find_package(GSL REQUIRED)
+ target_link_libraries(main PRIVATE GSL::gsl GSL::gslcblas)
diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index b3e27b5d0..a1989b23a 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -251,6 +251,18 @@ macro(find_package name) set_target_properties(hdf5::${HDF5TARGET}-static PROPERTIES INTERFACE_LINK_LIBRARIES "hdf5::${HDF5TARGET}-shared") endif() endforeach() + elseif("${name}" STREQUAL "GSL") + _find_package(${ARGV}) + if(GSL_FOUND AND TARGET GSL::gsl) + set_property( TARGET GSL::gslcblas APPEND PROPERTY IMPORTED_CONFIGURATIONS Release ) + set_property( TARGET GSL::gsl APPEND PROPERTY IMPORTED_CONFIGURATIONS Release ) + if( EXISTS "${GSL_LIBRARY_DEBUG}" AND EXISTS "${GSL_CBLAS_LIBRARY_DEBUG}") + set_property( TARGET GSL::gsl APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug ) + set_target_properties( GSL::gsl PROPERTIES IMPORTED_LOCATION_DEBUG "${GSL_LIBRARY_DEBUG}" ) + set_property( TARGET GSL::gslcblas APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug ) + set_target_properties( GSL::gslcblas PROPERTIES IMPORTED_LOCATION_DEBUG "${GSL_CBLAS_LIBRARY_DEBUG}" ) + endif() + endif() elseif("${name}" STREQUAL "CURL") _find_package(${ARGV}) if(CURL_FOUND) |
