Skip to content

Commit 05609fc

Browse files
authored
Conda build fixes (#18)
1 parent dc41bff commit 05609fc

File tree

3 files changed

+19
-30
lines changed

3 files changed

+19
-30
lines changed

CMakeLists.txt

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -52,34 +52,26 @@ option(EbsdLib_ENABLE_HDF5 "Enable HDF5 Support in the EbsdLibProj" ON)
5252
option(EbsdLib_BUILD_H5SUPPORT "Build H5Support Library" ON)
5353

5454
if(EbsdLib_ENABLE_HDF5)
55-
if(EbsdLib_Anaconda_Install)
56-
set(HDF5_USE_STATIC_LIBRARIES OFF)
57-
set(HDF5_FIND_COMPONENTS OFF)
58-
find_package(HDF5 1.10.6 EXACT MODULE REQUIRED)
59-
set(HDF5_C_TARGET_NAME hdf5::hdf5)
60-
else()
61-
find_package(HDF5 NAMES hdf5 REQUIRED)
62-
endif()
63-
64-
# If H5Support already exists no need to look for it (e.g. EbsdLib is added as a subdirectory in DREAM3D)
65-
if(NOT TARGET H5Support::H5Support AND EbsdLib_BUILD_H5SUPPORT)
66-
#------------------------------------------------------------------------------
67-
# If the developer has set another H5Support directory then use that, otherwise look
68-
# for the H5Support directory at the same level as the EBSDLib directory
69-
if("${H5Support_SOURCE_DIR}" STREQUAL "")
70-
if(EXISTS "${EbsdLib_PARENT}/H5Support")
71-
set(H5Support_SOURCE_DIR "${EbsdLib_PARENT}/H5Support")
72-
elseif(EXISTS "${EbsdLib_SOURCE_DIR}/H5Support")
73-
set(H5Support_SOURCE_DIR "${EbsdLib_SOURCE_DIR}/H5Support")
74-
else()
75-
message(FATAL_ERROR "H5Support_SOURCE_DIR was not set. Where is the H5Support project directory. Please set the H5Support_SOURCE_DIR variable to the CMP directory.")
55+
if(EbsdLib_BUILD_H5SUPPORT)
56+
if(NOT TARGET H5Support::H5Support)
57+
#------------------------------------------------------------------------------
58+
# If the developer has set another H5Support directory then use that, otherwise look
59+
# for the H5Support directory at the same level as the EBSDLib directory
60+
if("${H5Support_SOURCE_DIR}" STREQUAL "")
61+
if(EXISTS "${EbsdLib_PARENT}/H5Support")
62+
set(H5Support_SOURCE_DIR "${EbsdLib_PARENT}/H5Support")
63+
elseif(EXISTS "${EbsdLib_SOURCE_DIR}/H5Support")
64+
set(H5Support_SOURCE_DIR "${EbsdLib_SOURCE_DIR}/H5Support")
65+
else()
66+
message(FATAL_ERROR "H5Support_SOURCE_DIR was not set. Where is the H5Support project directory. Please set the H5Support_SOURCE_DIR variable to the CMP directory.")
67+
endif()
68+
message(STATUS "H5Support_SOURCE_DIR: ${H5Support_SOURCE_DIR}")
7669
endif()
77-
message(STATUS "H5Support_SOURCE_DIR: ${H5Support_SOURCE_DIR}")
78-
endif()
79-
add_subdirectory("${H5Support_SOURCE_DIR}" "${EbsdLibProj_BINARY_DIR}/H5Support")
80-
else()
81-
find_package(H5Support NAMES H5Support)
70+
add_subdirectory("${H5Support_SOURCE_DIR}" "${EbsdLibProj_BINARY_DIR}/H5Support")
8271
endif()
72+
else()
73+
find_package(H5Support REQUIRED)
74+
endif()
8375
endif()
8476
mark_as_advanced(EbsdLib_ENABLE_HDF5)
8577

Source/EbsdLib/Core/EbsdLibConstants.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
#pragma once
3737

38+
#include <cstdint>
3839
#include <string>
3940

4041
/**

Source/EbsdLib/SourceList.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,6 @@ add_library(${PROJECT_NAME} ${LIB_TYPE} ${EbsdLib_PROJECT_SRCS})
138138
# Now add in the H5Support sources to the current target
139139
if(EbsdLib_ENABLE_HDF5)
140140
target_link_libraries(${PROJECT_NAME} PUBLIC H5Support::H5Support)
141-
target_include_directories(${PROJECT_NAME}
142-
PUBLIC
143-
$<BUILD_INTERFACE:${H5Support_INCLUDE_DIRS}>
144-
)
145141
endif()
146142

147143
CMP_AddDefinitions(TARGET ${PROJECT_NAME})

0 commit comments

Comments
 (0)