Mercurial > hg > orthanc
comparison Resources/CMake/DcmtkConfiguration.cmake @ 2344:8a5c8af669cb
fix for osx
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 17 Jul 2017 23:41:31 +0200 |
parents | 157584fa9c21 |
children | 7b3b82d426ed |
comparison
equal
deleted
inserted
replaced
2343:15bca89f07bf | 2344:8a5c8af669cb |
---|---|
66 endif() | 66 endif() |
67 endif() | 67 endif() |
68 | 68 |
69 | 69 |
70 IF (CMAKE_CROSSCOMPILING) | 70 IF (CMAKE_CROSSCOMPILING) |
71 SET(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.") | 71 if (CMAKE_COMPILER_IS_GNUCXX AND |
72 ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") # MinGW | |
73 SET(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.") | |
74 else() | |
75 message(FATAL_ERROR "Support your platform here") | |
76 endif() | |
72 ENDIF() | 77 ENDIF() |
78 | |
73 SET(DCMTK_SOURCE_DIR ${DCMTK_SOURCES_DIR}) | 79 SET(DCMTK_SOURCE_DIR ${DCMTK_SOURCES_DIR}) |
74 include(${DCMTK_SOURCES_DIR}/CMake/CheckFunctionWithHeaderExists.cmake) | 80 include(${DCMTK_SOURCES_DIR}/CMake/CheckFunctionWithHeaderExists.cmake) |
75 include(${DCMTK_SOURCES_DIR}/CMake/GenerateDCMTKConfigure.cmake) | 81 include(${DCMTK_SOURCES_DIR}/CMake/GenerateDCMTKConfigure.cmake) |
76 | 82 |
77 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") | 83 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") |
93 CONFIGURE_FILE( | 99 CONFIGURE_FILE( |
94 ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in | 100 ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in |
95 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h) | 101 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h) |
96 | 102 |
97 if (NOT USE_DCMTK_360) | 103 if (NOT USE_DCMTK_360) |
98 # Configure Wine if cross-compiling for Windows | 104 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
99 if (CMAKE_CROSSCOMPILING AND WIN32) | 105 link_libraries(netapi32) # For NetWkstaUserGetInfo@12 |
100 include(${DCMTK_SOURCES_DIR}/CMake/dcmtkUseWine.cmake) | 106 link_libraries(iphlpapi) # For GetAdaptersInfo@8 |
101 FIND_PROGRAM(WINE_WINE_PROGRAM wine) | 107 |
102 FIND_PROGRAM(WINE_WINEPATH_PROGRAM winepath) | 108 # Configure Wine if cross-compiling for Windows |
103 list(APPEND DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=-static") | 109 if (CMAKE_COMPILER_IS_GNUCXX) |
110 include(${DCMTK_SOURCES_DIR}/CMake/dcmtkUseWine.cmake) | |
111 FIND_PROGRAM(WINE_WINE_PROGRAM wine) | |
112 FIND_PROGRAM(WINE_WINEPATH_PROGRAM winepath) | |
113 list(APPEND DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=-static") | |
114 endif() | |
104 endif() | 115 endif() |
105 | 116 |
106 # This step must be after the generation of "osconfig.h" | 117 # This step must be after the generation of "osconfig.h" |
107 INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES() | 118 INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES() |
108 | |
109 link_libraries(netapi32) # For NetWkstaUserGetInfo@12 | |
110 link_libraries(iphlpapi) # For GetAdaptersInfo@8 | |
111 endif() | 119 endif() |
112 | 120 |
113 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmdata/libsrc DCMTK_SOURCES) | 121 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmdata/libsrc DCMTK_SOURCES) |
114 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/ofstd/libsrc DCMTK_SOURCES) | 122 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/ofstd/libsrc DCMTK_SOURCES) |
115 | 123 |