CMakeLists.txt 492 B

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