]> Creatis software - gdcm.git/blob - src/gdcmjpegls/CMakeLists.txt
Fix mistypings
[gdcm.git] / src / gdcmjpegls / CMakeLists.txt
1 PROJECT(GDCMJPEGLS)
2
3 #-----------------------------------------------------------------------------
4 # Test if os defines a lenght for sockaddr
5 # only doing the test when we have sys/socket
6 IF("HAVE_C_INLINE" MATCHES "^HAVE_C_INLINE$")
7   STRING(ASCII 35 POUND)
8   FILE(WRITE ${GDCMJPEGLS_BINARY_DIR}/gdcmTestInline.c
9     "inline int foo() { return 0; }\n
10     int main() { return foo(); }")
11   MESSAGE(STATUS "Checking if C compiler has inline keyword")
12   TRY_COMPILE(HAVE_C_INLINE
13     ${GDCMJPEGLS_BINARY_DIR}
14     ${GDCMJPEGLS_BINARY_DIR}/gdcmTestInline.c
15     OUTPUT_VARIABLE OUTPUT)
16   IF(HAVE_C_INLINE)
17     MESSAGE(STATUS "Checking if C compiler has inline keyword -- yes")
18     SET(HAVE_C_INLINE 1 CACHE INTERNAL "Support if C compiler has inline keyword")
19     WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeOutput.log
20       "Determining if C compiler has inline keyword"
21       "passed with the following output:\n"
22       "${OUTPUT}\n" APPEND)
23   ELSE(HAVE_C_INLINE)
24     MESSAGE(STATUS "Checking if C compiler has inline keyword -- no")
25     SET(HAVE_C_INLINE 0 CACHE INTERNAL "Support if C compiler has inline keyword")
26     WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeError.log
27       "Determining if C compiler has inline keyword"
28       "failed with the following output:\n"
29       "${OUTPUT}\n" APPEND)
30   ENDIF(HAVE_C_INLINE)
31 ENDIF("HAVE_C_INLINE" MATCHES "^HAVE_C_INLINE$")
32
33 INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
34 CHECK_INCLUDE_FILE("unistd.h"    HAVE_UNISTD_H)
35 CONFIGURE_FILE(
36   "${GDCMJPEGLS_SOURCE_DIR}/jpegls_config.h.in"
37   "${GDCMJPEGLS_BINARY_DIR}/jpegls_config.h"
38   @ONLY IMMEDIATE)
39
40 SUBDIRS(Decoder
41   # Encoder
42   )