Newer
Older

Karsten Suehring
committed
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
# library
set( LIB_NAME EncoderLib )
# get source files
file( GLOB SRC_FILES "*.cpp" )
# get include files
file( GLOB INC_FILES "*.h" )
# NATVIS files for Visual Studio
if( MSVC )
file( GLOB NATVIS_FILES "../../VisualStudio/*.natvis" )
endif()
# library
add_library( ${LIB_NAME} STATIC ${SRC_FILES} ${INC_FILES} ${NATVIS_FILES} )
target_compile_definitions( ${LIB_NAME} PUBLIC )
if( ENABLE_VTM )
target_compile_definitions( ${LIB_NAME} PUBLIC JEM_TOOLS=0 )
endif()
if( EXTENSION_360_VIDEO )
target_compile_definitions( ${LIB_NAME} PUBLIC EXTENSION_360_VIDEO=1 )
endif()
if( SET_ENABLE_TRACING )
if( ENABLE_TRACING )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_TRACING=1 )
else()
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_TRACING=0 )
endif()
endif()
if( OpenMP_FOUND )
if( SET_ENABLE_SPLIT_PARALLELISM )
if( ENABLE_SPLIT_PARALLELISM )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=1 )
else()
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=0 )
endif()
endif()
if( SET_ENABLE_WPP_PARALLELISM )
if( ENABLE_WPP_PARALLELISM )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_WPP_PARALLELISM=1 )
else()
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
endif()
endif()
else()
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_SPLIT_PARALLELISM=0 )
target_compile_definitions( ${LIB_NAME} PUBLIC ENABLE_WPP_PARALLELISM=0 )
endif()
target_include_directories( ${LIB_NAME} PUBLIC . )
target_link_libraries( ${LIB_NAME} CommonLib Threads::Threads )
if( CMAKE_COMPILER_IS_GNUCC )
# this is quite certainly a compiler problem
set_property( SOURCE "EncCu.cpp" APPEND PROPERTY COMPILE_FLAGS "-Wno-array-bounds" )
endif()
# example: place header files in different folders
source_group( "Natvis Files" FILES ${NATVIS_FILES} )
# set the folder where to place the projects
set_target_properties( ${LIB_NAME} PROPERTIES FOLDER lib )