summaryrefslogtreecommitdiff
path: root/templates/cmake.mpd
blob: 94666a3f9d7e15725af1cbec8eab8c255ac77ee3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
cmake_minimum_required(VERSION <%cmake_minimum_required(3.3.0)%>)

<%marker(top)%>
project(<%project_name%> <%language%>)

<%if(contains(includes, DDS_ROOT))%>
find_package(OpenDDS REQUIRED)

<%else%>
<%if(contains(includes, TAO_ROOT))%>
find_package(TAO REQUIRED)

<%else%>
<%if(contains(includes, ACE_ROOT))%>
find_package(ACE REQUIRED)

<%else%>
<%endif%>
<%endif%>
<%endif%>
set(SOURCE_FILES <%non_generated_sources%>)
<%if(libs || lit_libs || pure_libs)%>
set(TARGET_LINK_LIBRARIES<%if(libs)%> <%libs%><%endif%><%if(lit_libs)%> <%lit_libs%><%endif%><%if(pure_libs)%> <%pure_libs%><%endif%>)
<%endif%>
<%if(exename)%>
set(PROJECT_TARGET <%exename%>)
<%else%>
<%if(sharedname)%>
set(PROJECT_TARGET <%sharedname%>)
<%else%>
<%if(staticname)%>
set(PROJECT_TARGET <%staticname%>)
<%endif%>
<%endif%>
<%endif%>
<%marker(macros)%>

<%if(exename)%>
add_executable(${PROJECT_TARGET} ${SOURCE_FILES})
target_link_libraries(${PROJECT_TARGET} ${TARGET_LINK_LIBRARIES})
<%else%>
<%if(sharedname)%>
add_library(${PROJECT_TARGET} SHARED ${SOURCE_FILES})
target_link_libraries(${PROJECT_TARGET} ${TARGET_LINK_LIBRARIES})
<%else%>
<%if(staticname)%>
add_library(${PROJECT_TARGET} ${SOURCE_FILES})
<%endif%>
<%endif%>
<%endif%>

<%if(includes)%>
target_include_directories(${PROJECT_TARGET} PUBLIC <%env_includes%>)

<%endif%>
<%if(custom_types)%>
<%foreach(custom_types)%>
<%if(custom_type->command && custom_type->input_files)%>
include(<%custom_type%>.cmake OPTIONAL)
<%uc(custom_type)%>_TARGET_SOURCES(${PROJECT_TARGET} PUBLIC <%custom_type->input_files%>)
<%endif%>
<%endfor%>
<%endif%>

<%marker(local)%>
<%marker(bottom)%>