-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
83 lines (71 loc) · 2.53 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
cmake_minimum_required(VERSION 2.8)
project( enkiTSExamples )
find_package(OpenGL)
include_directories("enkiTS/src")
include_directories("Remotery/lib")
include_directories("imgui")
include_directories("microprofile")
include_directories("glfw/include")
include_directories("imgui/examples")
include_directories( ${OPENGL_INCLUDE_DIRS} )
set( ENKITS_BUILD_EXAMPLES OFF CACHE BOOL "Build basic example applications" )
set( GLFW_BUILD_EXAMPLES OFF CACHE BOOL "GLFW lib only" )
set( GLFW_BUILD_TESTS OFF CACHE BOOL "GLFW lib only" )
set( GLFW_BUILD_DOCS OFF CACHE BOOL "GLFW lib only" )
set( GLFW_BUILD_INSTALL OFF CACHE BOOL "GLFW lib only" )
add_subdirectory( enkiTS )
if(OpenGL_FOUND)
add_subdirectory( glfw )
endif()
set( ENKITSREMOTERYSAMPLE_SRC
enkiTSRemoteryExample.cpp
Remotery/lib/Remotery.h
Remotery/lib/Remotery.c
)
add_executable( enkiTSRemoteryExample ${ENKITSREMOTERYSAMPLE_SRC} )
target_link_libraries(enkiTSRemoteryExample enkiTS )
if( ENKITS_BUILD_C_INTERFACE )
set( ENKITSREMOTERYSAMPLE_C_SRC
enkiTSRemoteryExample.c
Remotery/lib/Remotery.h
Remotery/lib/Remotery.c
)
add_executable( enkiTSRemoteryExample_C ${ENKITSREMOTERYSAMPLE_C_SRC} )
target_link_libraries(enkiTSRemoteryExample_C enkiTS )
endif()
if(UNIX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()
if(APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
if( MSVC )
SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ENTRY:mainCRTStartup" )
endif()
if(OpenGL_FOUND)
set( ENKITSMICROPROFILESAMPLE_SRC
microprofile/microprofile.h
microprofile/microprofileui.h
imgui/imgui.h
imgui/imgui.cpp
imgui/imgui_internal.h
imgui/imgui_demo.cpp
imgui/imgui_draw.cpp
imgui/imgui_widgets.cpp
imgui/imconfig.h
imgui/examples/imgui_impl_glfw.h
imgui/examples/imgui_impl_glfw.cpp
imgui/examples/imgui_impl_opengl2.h
imgui/examples/imgui_impl_opengl2.cpp
enkiTSMicroprofileExample.cpp
)
add_executable( enkiTSMicroprofileExample WIN32 ${ENKITSMICROPROFILESAMPLE_SRC} )
target_link_libraries(enkiTSMicroprofileExample enkiTS ${OPENGL_LIBRARIES} glfw ${GLFW_LIBRARIES} )
endif()
if( MSVC )
if(${CMAKE_VERSION} VERSION_LESS "3.6.0")
message( "\n\t[ WARNING ]\n\n\tCMake version lower than 3.6.\n\n\t - Please update CMake and rerun; OR\n\t - Manually set one of the 'Example' projects as StartUp Project in Visual Studio.\n" )
else()
set_property( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT enkiTSMicroprofileExample )
endif()
endif()