File: CMakeLists.txt

package info (click to toggle)
openmohaa 0.81.1%2Bdfsg-2
  • links: PTS, VCS
  • area: contrib
  • in suites: trixie
  • size: 29,124 kB
  • sloc: ansic: 270,865; cpp: 250,173; sh: 234; asm: 141; xml: 64; makefile: 7
file content (32 lines) | stat: -rw-r--r-- 1,152 bytes parent folder | download
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
cmake_minimum_required(VERSION 3.12)

project(omohrenderergl1)

file(GLOB_RECURSE SOURCES_RENDERER "./*.c" "./*.cpp")

if (${USE_RENDERER_DLOPEN})
	add_library(omohrenderergl1 SHARED ${SOURCES_RENDERER})
else()
	add_library(omohrenderergl1 STATIC ${SOURCES_RENDERER})
endif()

target_compile_features(omohrenderergl1 PUBLIC cxx_nullptr)
target_compile_features(omohrenderergl1 PUBLIC c_variadic_macros)
target_link_libraries(omohrenderergl1 PRIVATE omohrenderer_common)

get_target_property(target_type omohrenderergl1 TYPE)
if (target_type STREQUAL "SHARED_LIBRARY")
	target_sources(omohrenderergl1 PRIVATE "./tr_subs.c")
	target_compile_definitions(omohrenderergl1 PUBLIC USE_RENDERER_DLOPEN=1)
endif ()

set_target_properties(omohrenderergl1 PROPERTIES PREFIX "")
set_target_properties(omohrenderergl1 PROPERTIES OUTPUT_NAME "renderer_opengl1${TARGET_BIN_SUFFIX}")

if (target_type STREQUAL "SHARED_LIBRARY")
	INSTALL(TARGETS omohrenderergl1 DESTINATION ${CMAKE_INSTALL_LIBDIR}/${LIB_INSTALL_SUBDIR})

	if(MSVC)
		INSTALL(FILES $<TARGET_PDB_FILE:omohrenderergl1> DESTINATION ${CMAKE_INSTALL_LIBDIR}/${LIB_INSTALL_SUBDIR} OPTIONAL)
	endif()
endif ()