-
Notifications
You must be signed in to change notification settings - Fork 51
/
CMakeLists.txt
56 lines (45 loc) · 2.21 KB
/
CMakeLists.txt
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
# Collect source files into the "sources" variable and unit test files into the
# "gtest_sources" variable.
ign_get_libsources_and_unittests(sources gtest_sources)
if (MSVC)
# Warning #4251 is the "dll-interface" warning that tells you when types used
# by a class are not being exported. These generated source files have private
# members that don't get exported, so they trigger this warning. However, the
# warning is not important since those members do not need to be interfaced
# with.
set_source_files_properties(${sources} ${gtest_sources} COMPILE_FLAGS "/wd4251")
endif()
set(engine_name "ogre2")
ign_add_component(${engine_name} SOURCES ${sources} GET_TARGET_NAME ogre2_target)
find_package(OpenGL)
set_property(
SOURCE Ogre2RenderEngine.cc
PROPERTY COMPILE_DEFINITIONS
IGN_RENDERING_RESOURCE_PATH="${IGN_RENDERING_RESOURCE_PATH}"
OGRE2_RESOURCE_PATH="${OGRE2_RESOURCE_PATH}"
OGRE2_VERSION="${OGRE2_VERSION}"
)
target_link_libraries(${ogre2_target}
PUBLIC
${ignition-common${IGN_COMMON_VER}_LIBRARIES}
PRIVATE
ignition-plugin${IGN_PLUGIN_VER}::register
${OPENGL_LIBRARIES}
IgnOGRE2::IgnOGRE2)
set (versioned ${CMAKE_SHARED_LIBRARY_PREFIX}${PROJECT_NAME_LOWER}-${engine_name}${CMAKE_SHARED_LIBRARY_SUFFIX})
set (unversioned ${CMAKE_SHARED_LIBRARY_PREFIX}${PROJECT_NAME_NO_VERSION_LOWER}-${engine_name}${CMAKE_SHARED_LIBRARY_SUFFIX})
# Note that plugins are currently being installed in 2 places: /lib and the engine-plugins dir
install(TARGETS ${ogre2_target} DESTINATION ${IGNITION_RENDERING_ENGINE_INSTALL_DIR})
if (WIN32)
# disable MSVC inherit via dominance warning
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250")
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy
${IGNITION_RENDERING_ENGINE_INSTALL_DIR}\/${versioned}
${IGNITION_RENDERING_ENGINE_INSTALL_DIR}\/${unversioned})")
else()
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${versioned} ${unversioned})
INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${IGNITION_RENDERING_ENGINE_INSTALL_DIR})
endif()
# Build the unit tests
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources} LIB_DEPS ${ogre2_target})
install(DIRECTORY "media" DESTINATION ${IGN_RENDERING_RESOURCE_PATH}/ogre2)