1 # this enables only C, i.e. disables C++
4 add_library(SimpleCLib STATIC bar.c foo.c)
6 add_executable(SimpleC main.c)
7 target_link_libraries(SimpleC SimpleCLib)
9 # and some check, just to make sure it works:
10 include(CheckTypeSize)
11 check_type_size(float SIZE_FLOAT)
12 message(STATUS "sizeof(float): ${SIZE_FLOAT}")
14 # make sure optimized libs are not used by debug builds
15 if(CMAKE_BUILD_TYPE MATCHES Debug)
16 target_link_libraries(Simple optimized c:/not/here.lib )
17 endif(CMAKE_BUILD_TYPE MATCHES Debug)