Skip to content

Commit

Permalink
Merge 734cb0c into cb5b144
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrush committed Jan 17, 2020
2 parents cb5b144 + 734cb0c commit 92c4747
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/cmake/CMakeBasics.cmake
Expand Up @@ -242,7 +242,7 @@ macro(add_compiled_library)
EXPORT ${args_EXPORT}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION lib)
RUNTIME DESTINATION bin)
endif()
endif()

Expand Down
3 changes: 2 additions & 1 deletion src/cmake/SetupTests.cmake
Expand Up @@ -155,10 +155,11 @@ function(add_python_test )
PROPERTY
ENVIRONMENT "PYTHONPATH=${py_path}${CMAKE_BINARY_DIR}/python-modules/${ENV_PATH_SEP}${CMAKE_CURRENT_SOURCE_DIR}")
if(WIN32)
# proper path to dlls for vstudio and proper path for non config based gen (nmake, etc)
set_property(TEST ${TEST}
APPEND
PROPERTY
ENVIRONMENT "PATH=${CMAKE_BINARY_DIR}/bin/$<CONFIG>/${ENV_PATH_SEP}$ENV{PATH}")
ENVIRONMENT "PATH=${CMAKE_BINARY_DIR}/bin/${ENV_PATH_SEP}${CMAKE_BINARY_DIR}/bin/$<CONFIG>/${ENV_PATH_SEP}$ENV{PATH}")
endif()

# set folder if passed
Expand Down
57 changes: 30 additions & 27 deletions src/cmake/thirdparty/SetupHDF5.cmake
Expand Up @@ -63,21 +63,11 @@ if(NOT WIN32)
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
set(ENV{HDF5_ROOT} ${HDF5_ROOT}/bin)
endif()
# Use CMake's FindHDF5 module, which uses hdf5's compiler wrappers to extract
# all the info about the hdf5 install
include(FindHDF5)
else()
# CMake's FindHDF5 module is buggy on windows and will put the dll
# in HDF5_LIBRARY. Instead, use the 'CONFIG' signature of find_package
# with appropriate hints for where cmake can find hdf5-config.cmake.
find_package(HDF5 CONFIG
REQUIRED
HINTS ${HDF5_DIR}/cmake/hdf5
${HDF5_DIR}/lib/cmake/hdf5
${HDF5_DIR}/share/cmake/hdf5
${HDF5_DIR}/cmake)
endif()

# Use CMake's FindHDF5 module to locate hdf5 and setup hdf5
find_package(HDF5 REQUIRED)

# FindHDF5/find_package sets HDF5_DIR to it's installed CMake info if it exists
# we want to keep HDF5_DIR as the root dir of the install to be
# consistent with other packages
Expand Down Expand Up @@ -110,6 +100,10 @@ if(NOT HDF5_INCLUDE_DIRS)
endif()
endif()

if(NOT HDF5_LIBRARIES)
message(FATAL_ERROR "FindHDF5 did not provide HDF5_LIBRARIES.")
endif()

message(STATUS "HDF5_INCLUDE_DIRS=${HDF5_INCLUDE_DIRS}")
set(check_hdf5_inc_dir_ok 0)
foreach(IDIR ${HDF5_INCLUDE_DIRS})
Expand Down Expand Up @@ -263,24 +257,33 @@ set(CONDUIT_HDF5_TPL_LIB_FLAGS ${hdf5_tpl_lnk_flags})
#
# Display main hdf5 cmake vars
#
message(STATUS "HDF5 Include Dirs ${HDF5_INCLUDE_DIRS}")
message(STATUS "HDF5 Libraries ${HDF5_LIBRARIES}")
message(STATUS "HDF5 is parallel ${HDF5_IS_PARALLEL}")
message(STATUS "HDF5 Include Dirs: ${HDF5_INCLUDE_DIRS}")
message(STATUS "HDF5 Libraries: ${HDF5_LIBRARIES}")
message(STATUS "HDF5 Definitions: ${HDF5_DEFINITIONS}")
message(STATUS "HDF5 is parallel: ${HDF5_IS_PARALLEL}")

message(STATUS "HDF5 Thirdparty Include Flags: ${hdf5_tpl_inc_flags}")
message(STATUS "HDF5 Thirdparty Link Flags: ${hdf5_tpl_lnk_flags}")

# if newer style hdf5 imported targets exist, use those on windows
if(WIN32 AND TARGET hdf5::hdf5-shared)
if(BUILD_SHARED_LIBS)
blt_register_library(NAME hdf5
LIBRARIES hdf5::hdf5-shared)
else()
blt_register_library(NAME hdf5
LIBRARIES hdf5::hdf5-static)
endif()
if(WIN32 AND TARGET hdf5::hdf5-shared AND BUILD_SHARED_LIBS)
# reg shared ver of imported lib target
message(STATUS "HDF5 using hdf5::hdf5-shared target")
blt_register_library(NAME hdf5
LIBRARIES hdf5::hdf5-shared)
elseif(WIN32 AND TARGET hdf5::hdf5-static )
# reg static ver of imported lib target
message(STATUS "HDF5 using hdf5::hdf5-static target")
blt_register_library(NAME hdf5
LIBRARIES hdf5::hdf5-static)
else()
# reg includes and libs with blt
message(STATUS "HDF5 using HDF5_DEFINITIONS + HDF5_INCLUDE_DIRS + HDF5_LIBRARIES")
message(STATUS "HDF5_DEFINITIONS: ${HDF5_DEFINITIONS}")
message(STATUS "HDF5_INCLUDE_DIRS: ${HDF5_INCLUDE_DIRS}")
message(STATUS "HDF5_LIBRARIES: ${HDF5_LIBRARIES}")
blt_register_library(NAME hdf5
INCLUDES ${HDF5_INCLUDE_DIRS}
LIBRARIES ${HDF5_LIBRARIES} )
endif()
DEFINES ${HDF5_DEFINITIONS}
INCLUDES ${HDF5_INCLUDE_DIRS}
LIBRARIES ${HDF5_LIBRARIES})
endif()
7 changes: 6 additions & 1 deletion src/cmake/thirdparty/SetupPython.cmake
Expand Up @@ -186,12 +186,17 @@ FUNCTION(PYTHON_ADD_DISTUTILS_SETUP target_name
# also use distutils for the install ...
# if PYTHON_MODULE_INSTALL_PREFIX is set, install there
if(PYTHON_MODULE_INSTALL_PREFIX)
set(py_mod_inst_prefix ${PYTHON_MODULE_INSTALL_PREFIX})
# make sure windows style paths don't ruin our day (or night)
if(WIN32)
string(REGEX REPLACE "/" "\\\\" py_mod_inst_prefix ${PYTHON_MODULE_INSTALL_PREFIX})
endif()
INSTALL(CODE
"
EXECUTE_PROCESS(WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${PYTHON_EXECUTABLE} ${setup_file} -v
build --build-base=${CMAKE_CURRENT_BINARY_DIR}/${target_name}_build_install
install --install-purelib=${PYTHON_MODULE_INSTALL_PREFIX}
install --install-purelib=${py_mod_inst_prefix}
OUTPUT_VARIABLE PY_DIST_UTILS_INSTALL_OUT)
MESSAGE(STATUS \"\${PY_DIST_UTILS_INSTALL_OUT}\")
")
Expand Down

0 comments on commit 92c4747

Please sign in to comment.