comparison Resources/CMake/DcmtkConfiguration.cmake @ 2340:b5a04d983647

fix mingw build
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 17 Jul 2017 22:35:42 +0200
parents 6e26d363dc53
children 157584fa9c21
comparison
equal deleted inserted replaced
2339:6e26d363dc53 2340:b5a04d983647
93 CONFIGURE_FILE( 93 CONFIGURE_FILE(
94 ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in 94 ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in
95 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h) 95 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h)
96 96
97 if (NOT USE_DCMTK_360) 97 if (NOT USE_DCMTK_360)
98 # Configure Wine if cross-compiling for Windows
99 if (CMAKE_CROSSCOMPILING AND WIN32)
100 include(${DCMTK_SOURCES_DIR}/CMake/dcmtkUseWine.cmake)
101 FIND_PROGRAM(WINE_WINE_PROGRAM wine)
102 FIND_PROGRAM(WINE_WINEPATH_PROGRAM winepath)
103 list(APPEND DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=-static")
104 endif()
105
98 # This step must be after the generation of "osconfig.h" 106 # This step must be after the generation of "osconfig.h"
99 INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES() 107 INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES()
108
109 link_libraries(-lnetapi32) # For NetWkstaUserGetInfo@12
110 link_libraries(-liphlpapi) # For GetAdaptersInfo@8
100 endif() 111 endif()
101 112
102 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmdata/libsrc DCMTK_SOURCES) 113 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmdata/libsrc DCMTK_SOURCES)
103 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/ofstd/libsrc DCMTK_SOURCES) 114 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/ofstd/libsrc DCMTK_SOURCES)
104 115
180 endif() 191 endif()
181 192
182 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") 193 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
183 list(REMOVE_ITEM DCMTK_SOURCES 194 list(REMOVE_ITEM DCMTK_SOURCES
184 ${DCMTK_SOURCES_DIR}/oflog/libsrc/unixsock.cc 195 ${DCMTK_SOURCES_DIR}/oflog/libsrc/unixsock.cc
196 ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc
185 ) 197 )
186 198
187 if (CMAKE_COMPILER_IS_GNUCXX AND DCMTK_PATCH_MINGW64) 199 if (CMAKE_COMPILER_IS_GNUCXX AND DCMTK_PATCH_MINGW64)
188 # This is a patch for MinGW64 200 # This is a patch for MinGW64
189 execute_process( 201 execute_process(