# # hello/CMakeLists.txt -- # cmake_minimum_required(VERSION 2.6) project(HELLO C) add_executable(hello-naive hello-naive.c) #set_property(TARGET hello-naive APPEND PROPERTY LINK_FLAGS "-static") add_executable(hello-stdio hello-stdio.c) add_executable(hello-sleep hello-sleep.c) add_executable(hello-signal hello-signal.c) add_executable(hello-write hello-write.c) #set_property(TARGET hello-write APPEND PROPERTY LINK_FLAGS "-static") add_executable(hello-writev hello-writev.c) add_executable(hello-syscall hello-syscall.c) add_executable(hello-atexit hello-atexit.c) add_executable(hello-snowman hello-snowman.c) add_executable(hello-gettext hello-gettext.c) INCLUDE(FindPkgConfig) pkg_check_modules(GLIB2 glib-2.0) add_definitions(${GLIB2_CFLAGS}) add_executable(hello-glib hello-glib.c) target_link_libraries(hello-glib ${GLIB2_LDFLAGS}) add_executable(hello-glib-event hello-glib-event.c) target_link_libraries(hello-glib-event ${GLIB2_LDFLAGS}) add_executable(hello-glib-threads hello-glib-event.c) target_link_libraries(hello-glib-threads ${GLIB2_LDFLAGS}) INCLUDE(FindIntl) target_link_libraries(hello-gettext ${Intl_LIBRARIES}) target_include_directories(hello-gettext PUBLIC ${Intl_INCLUDE_DIRS}) if(CMAKE_C_COMPILER_ID MATCHES "GNU") add_definitions(--std=c99 -O2 -Wall) endif() if(CMAKE_C_COMPILER_ID MATCHES "Clang") add_definitions(--std=c99 -O2 -Wall) endif()