CMakeLists.txt 834 B

1234567891011121314151617181920212223
  1. # a simple C only test case
  2. cmake_minimum_required (VERSION 2.6)
  3. project (COnly C)
  4. set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix")
  5. add_library(testc1 STATIC libc1.c)
  6. add_library(testc2 SHARED libc2.c)
  7. add_executable (COnly conly.c foo.c foo.h)
  8. target_link_libraries(COnly testc1 testc2)
  9. if(MSVC_VERSION)
  10. set_target_properties(COnly PROPERTIES
  11. LINK_FLAGS " /NODEFAULTLIB:\"libcdg.lib\" /NODEFAULTLIB:\"libcmtg.lib\" /NODEFAULTLIB:\"foomsvcrt.lib\" /NODEFAULTLIB:\"libbar.lib\" /NODEFAULTLIB:\"libfooba.lib\"")
  12. endif()
  13. string(ASCII 35 32 67 77 97 107 101 ASCII_STRING)
  14. message(STATUS "String: ${ASCII_STRING}")
  15. get_source_file_property(LANG conly.c LANGUAGE)
  16. if("${LANG}" STREQUAL "C")
  17. message("Language is C")
  18. else()
  19. message(FATAL_ERROR "Bad language for file conly.c")
  20. endif()
  21. add_library(testCModule MODULE testCModule.c)