2002-04-03 00:43:23 +04:00
|
|
|
# a simple C only test case
|
2008-03-25 18:27:18 +03:00
|
|
|
cmake_minimum_required (VERSION 2.6)
|
2007-05-11 18:22:20 +04:00
|
|
|
project (COnly C)
|
2003-11-01 00:55:49 +03:00
|
|
|
|
2005-06-20 19:49:29 +04:00
|
|
|
set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix")
|
|
|
|
add_library(testc1 STATIC libc1.c)
|
|
|
|
add_library(testc2 SHARED libc2.c)
|
2007-05-11 18:22:20 +04:00
|
|
|
add_executable (COnly conly.c foo.c foo.h)
|
|
|
|
target_link_libraries(COnly testc1 testc2)
|
2007-12-06 16:40:18 +03:00
|
|
|
if(MSVC_VERSION)
|
|
|
|
set_target_properties(COnly PROPERTIES
|
2007-12-07 06:38:29 +03:00
|
|
|
LINK_FLAGS " /NODEFAULTLIB:\"libcdg.lib\" /NODEFAULTLIB:\"libcmtg.lib\" /NODEFAULTLIB:\"foomsvcrt.lib\" /NODEFAULTLIB:\"libbar.lib\" /NODEFAULTLIB:\"libfooba.lib\"")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2005-06-20 19:49:29 +04:00
|
|
|
string(ASCII 35 32 67 77 97 107 101 ASCII_STRING)
|
|
|
|
message(STATUS "String: ${ASCII_STRING}")
|
2007-12-18 17:57:41 +03:00
|
|
|
get_source_file_property(LANG conly.c LANGUAGE)
|
|
|
|
if("${LANG}" STREQUAL "C")
|
|
|
|
message("Language is C")
|
2012-08-13 21:50:14 +04:00
|
|
|
else()
|
2007-12-18 17:57:41 +03:00
|
|
|
message(FATAL_ERROR "Bad language for file conly.c")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-02-03 19:36:26 +04:00
|
|
|
|
|
|
|
add_library(testCModule MODULE testCModule.c)
|