summaryrefslogtreecommitdiffstats
path: root/Tests/ObjectLibrary/CMakeLists.txt
blob: 1a07d1d0a133e45bd40211f387c2dfc01bacdd33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
cmake_minimum_required(VERSION 2.8)
project(ObjectLibrary C)

add_subdirectory(A)
add_subdirectory(B)

add_library(Cstatic STATIC c.c $<TARGET_OBJECTS:A> $<TARGET_OBJECTS:B>)
add_executable(UseCstatic main.c)
target_link_libraries(UseCstatic Cstatic)

add_library(Cshared SHARED c.c $<TARGET_OBJECTS:A> $<TARGET_OBJECTS:Bexport>)
add_executable(UseCshared main.c)
set_property(TARGET UseCshared PROPERTY COMPILE_DEFINITIONS SHARED_C)
target_link_libraries(UseCshared Cshared)

add_executable(UseCinternal main.c c.c $<TARGET_OBJECTS:A> $<TARGET_OBJECTS:B>)