With Ward's help, I figured out how to

obviate the need for build type under
cmake+Visual-studio. This simplified
findplugin.in.
This commit is contained in:
Dennis Heimbigner 2018-01-16 13:28:30 -07:00
parent 99fccab359
commit 70068d7d32
4 changed files with 23 additions and 20 deletions

View File

@ -57,7 +57,7 @@ NCLIB=`pwd`
if test "x$VS" != x ; then
# Visual Studio
CFG="Release"
NCLIB="${NCLIB}/liblib/$CFG"
NCLIB="${NCLIB}/liblib"
export PATH="${NCLIB}:${PATH}"
#G=
cmake "$G" -DCMAKE_BUILD_TYPE=${CFG} $FLAGS ..

View File

@ -33,6 +33,15 @@ IF(MOD_NETCDF_NAME)
SET_TARGET_PROPERTIES(netcdf PROPERTIES RUNTIME_OUTPUT_NAME ${NETCDF_LIB_NAME})
ENDIF()
IF(MSVC)
SET_TARGET_PROPERTIES(netcdf PROPERTIES RUNTIME_OUTPUT_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR})
SET_TARGET_PROPERTIES(netcdf PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG
${CMAKE_CURRENT_BINARY_DIR})
SET_TARGET_PROPERTIES(netcdf PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE
${CMAKE_CURRENT_BINARY_DIR})
ENDIF()
#####
# Add dependencies required for linking.
#####

View File

@ -15,6 +15,10 @@
# Variable HDF5_PLUGIN_PATH is setthe absolute path to the
# directory containing the plugin library file
# Local variables are prefixed with FP_
#
# Note: we assume that the use of the CMAKE_BUILD_TYPE
# is obviated by setting the LIBRARY_OUTPUT_DIRECTORY
# variables: see hdf5plugins/CMakeLists.txt
findplugin() {
@ -32,18 +36,6 @@ if test "x$FP_OS" = xDarwin ; then FP_ISOSX=1; fi
FP_OS=`uname | cut -d '_' -f 1`
if test "x$FP_OS" = xCYGWIN ; then FP_ISCYGWIN=1; fi
if test "x$FP_ISCMAKE" != x ; then
FP_BUILDTYPE="@CMAKE_BUILD_TYPE@"
if test "x$FP_BUILDTYPE" != x; then
# Camel-case the build type
FP_C1=${FP_BUILDTYPE:0:1}
FP_CN=${FP_BUILDTYPE:1}
FP_C1=`echo -n "$FP_C1" | tr '[:lower:]' '[:upper:]'`
FP_CN=`echo -n "$FP_CN" | tr '[:upper:]' '[:lower:]'`
FP_BUILDTYPE="${FP_C1}${FP_CN}"
fi
fi
FP_PLUGINS=`pwd`
FP_PLUGINS="$FP_PLUGINS/hdf5plugins"
@ -67,13 +59,9 @@ fi
# Do not know where to look for a dylib
# Case 1: Cmake with Visual Studio
if test "x$FP_ISCMAKE" != x -a "x${FP_ISMSVC}" != x ; then
# Case 1a: try the build type directory
if test -f "${FP_PLUGINS}/${FP_BUILDTYPE}/${FP_PLUGIN_LIB}" ; then
FP_PLUGIN_PATH="${FP_PLUGINS}/${FP_BUILDTYPE}"
else # Case 1b Ignore the build type dir
if test -f "${FP_PLUGINS}/${FP_PLUGIN_LIB}" ; then
FP_PLUGIN_PATH="${FP_PLUGINS}"
fi
# Case 1a: ignore the build type directory
if test -f "${FP_PLUGINS}/${FP_PLUGIN_LIB}" ; then
FP_PLUGIN_PATH="${FP_PLUGINS}"
fi
else # Case 2: automake
# Case 2a: look in .libs

View File

@ -9,6 +9,12 @@ IF(BUILD_UTILITIES)
# LDFLAGS = -module -avoid-version -shared -export-dynamic -no-undefined
IF(MSVC)
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_CURRENT_BINARY_DIR}")
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_CURRENT_BINARY_DIR}")
ENDIF()
ADD_LIBRARY(bzip2 MODULE ${libbzip2_SOURCES})
SET_TARGET_PROPERTIES(bzip2 PROPERTIES LIBRARY_OUTPUT_NAME "bzip2")
SET_TARGET_PROPERTIES(bzip2 PROPERTIES ARCHIVE_OUTPUT_NAME "bzip2")