comparison Resources/CMake/Compiler.cmake @ 1967:83a2431a455f

fix for old version of mingw
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 11 Apr 2016 12:34:26 +0200
parents 01de36d949c3
children e7ae0185b77e
comparison
equal deleted inserted replaced
1966:8c506670f3cd 1967:83a2431a455f
71 -D_FILE_OFFSET_BITS=64 71 -D_FILE_OFFSET_BITS=64
72 ) 72 )
73 link_libraries(dl) 73 link_libraries(dl)
74 endif() 74 endif()
75 75
76 CHECK_INCLUDE_FILES(uuid/uuid.h HAVE_UUID_H)
77 if (NOT HAVE_UUID_H)
78 message(FATAL_ERROR "Please install the uuid-dev package")
79 endif()
80
76 elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") 81 elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
77 if (MSVC) 82 if (MSVC)
78 message("MSVC compiler version = " ${MSVC_VERSION} "\n") 83 message("MSVC compiler version = " ${MSVC_VERSION} "\n")
79 # Starting Visual Studio 2013 (version 1800), it is not possible 84 # Starting Visual Studio 2013 (version 1800), it is not possible
80 # to target Windows XP anymore 85 # to target Windows XP anymore
123 add_definitions( 128 add_definitions(
124 -D_XOPEN_SOURCE=1 129 -D_XOPEN_SOURCE=1
125 ) 130 )
126 link_libraries(iconv) 131 link_libraries(iconv)
127 132
133 CHECK_INCLUDE_FILES(uuid/uuid.h HAVE_UUID_H)
134 if (NOT HAVE_UUID_H)
135 message(FATAL_ERROR "Please install the uuid-dev package")
136 endif()
137
128 endif() 138 endif()
129 139
130 140
131 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") 141 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
132 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --lsb-target-version=${LSB_TARGET_VERSION} -I${LSB_PATH}/include") 142 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --lsb-target-version=${LSB_TARGET_VERSION} -I${LSB_PATH}/include")
142 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib") 152 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib")
143 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L/usr/local/lib") 153 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L/usr/local/lib")
144 endif() 154 endif()
145 155
146 156
147 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
148 CHECK_INCLUDE_FILES(rpc.h HAVE_UUID_H)
149 else()
150 CHECK_INCLUDE_FILES(uuid/uuid.h HAVE_UUID_H)
151 endif()
152
153 if (NOT HAVE_UUID_H)
154 message(FATAL_ERROR "Please install the uuid-dev package")
155 endif()
156
157
158 if (STATIC_BUILD) 157 if (STATIC_BUILD)
159 add_definitions(-DORTHANC_STATIC=1) 158 add_definitions(-DORTHANC_STATIC=1)
160 else() 159 else()
161 add_definitions(-DORTHANC_STATIC=0) 160 add_definitions(-DORTHANC_STATIC=0)
162 endif() 161 endif()