-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
33 lines (24 loc) · 1.04 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
cmake_minimum_required (VERSION 2.8)
project (tinyweb)
#version number
set (tinyweb_VERSION_MAJOR 1)
set (tinyweb_VERSION_MINOR 0)
#build arch option
option(i386 "i386" OFF)
option(x86_64 "x86_64" OFF)
find_package(Threads REQUIRED)
add_executable(tinyweb websocket.c tinyweb.c mongoose.c)
target_link_libraries(tinyweb "${CMAKE_THREAD_LIBS_INIT}")
target_link_libraries(tinyweb ${CMAKE_DL_LIBS})
add_executable(cgi-getfield cgi-getfield.c)
add_executable(cgi-getcookie cgi-getcookie.c)
IF(i386)
set_target_properties(tinyweb PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
set_target_properties(cgi-getfield PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
set_target_properties(cgi-getcookie PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
ENDIF()
IF(x86_64)
set_target_properties(tinyweb PROPERTIES COMPILE_FLAGS "-m64" LINK_FLAGS "-m64")
set_target_properties(cgi-getfield PROPERTIES COMPILE_FLAGS "-m64" LINK_FLAGS "-m64")
set_target_properties(cgi-getcookie PROPERTIES COMPILE_FLAGS "-m64" LINK_FLAGS "-m64")
ENDIF()