Skip to content

Commit 8f026e1

Browse files
authored
Update CMakeLists.txt
1 parent 4a22b16 commit 8f026e1

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

CMakeLists.txt

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,25 @@ endfunction()
5050

5151
message(STATUS "Configuring ${PROJECT_NAME} ${PROJECT_VERSION}")
5252

53-
# Configure config_type.h
53+
# Configure config_type.h (workaround to work both configure and cmake)
5454
set(INCLUDE_INTTYPES_H 0)
5555
set(INCLUDE_STDINT_H 0)
5656
set(INCLUDE_SYS_TYPES_H 0)
57-
check_include_files(inttypes.h INCLUDE_INTTYPES_H)
58-
check_include_files(stdint.h INCLUDE_STDINT_H)
59-
check_include_files(sys/types.h INCLUDE_SYS_TYPES_H)
57+
check_include_files(inttypes.h INCLUDE_INTTYPES_H_)
58+
check_include_files(stdint.h INCLUDE_STDINT_H_)
59+
check_include_files(sys/types.h INCLUDE_SYS_TYPES_H_)
60+
61+
if(INCLUDE_INTTYPES_H_ EQUAL 1)
62+
set(INCLUDE_INTTYPES_H 1)
63+
endif()
64+
65+
if(INCLUDE_STDINT_H_ EQUAL 1)
66+
set(INCLUDE_STDINT_H 1)
67+
endif()
68+
69+
if(INCLUDE_SYS_TYPES_H_ EQUAL 1)
70+
set(INCLUDE_SYS_TYPES_H 1)
71+
endif()
6072

6173
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
6274
set(SIZE16 int16_t)

0 commit comments

Comments
 (0)