2016-08-29 22:31:11 +02:00
|
|
|
PROJECT ( MESHUP )
|
|
|
|
|
|
|
|
CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
|
|
|
|
|
|
|
|
# Needed for UnitTest++
|
|
|
|
LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake )
|
|
|
|
|
|
|
|
# Perform the proper linking
|
|
|
|
SET (CMAKE_SKIP_BUILD_RPATH FALSE)
|
|
|
|
SET (CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
|
|
|
SET (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
|
|
|
SET (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
|
|
|
|
2017-02-22 21:35:14 +01:00
|
|
|
# For YouCompleteMe
|
|
|
|
SET (CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
|
2016-08-29 22:31:11 +02:00
|
|
|
# Enable proper C++11 flags
|
|
|
|
include(CheckCXXCompilerFlag)
|
|
|
|
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
|
|
|
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
|
|
|
|
if(COMPILER_SUPPORTS_CXX11)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
|
|
|
elseif(COMPILER_SUPPORTS_CXX0X)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
|
|
|
else()
|
|
|
|
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
|
|
|
|
endif()
|
|
|
|
|
2016-11-25 22:27:37 +01:00
|
|
|
# enable strings in GDB
|
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_DEBUG")
|
|
|
|
|
2017-02-22 21:35:14 +01:00
|
|
|
# enable LuaModel addon for RBDL
|
|
|
|
SET (RBDL_BUILD_ADDON_LUAMODEL ON)
|
|
|
|
SET (RBDL_USE_SIMPLE_MATH ON)
|
|
|
|
|
2016-08-29 22:31:11 +02:00
|
|
|
INCLUDE_DIRECTORIES (
|
|
|
|
${QT_INCLUDE_DIR}/QtOpenGL
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
2016-08-31 22:44:29 +02:00
|
|
|
|
|
|
|
# Required to compile RCPP related code
|
2016-08-31 22:35:33 +02:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty
|
2016-09-08 23:35:12 +02:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/bgfx
|
2017-02-22 21:35:14 +01:00
|
|
|
|
|
|
|
# RBDL and its LuaModel addon
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/3rdparty/rbdl/
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/3rdparty/rbdl/include
|
2016-08-29 22:31:11 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
FIND_PACKAGE (X11 REQUIRED)
|
|
|
|
FIND_PACKAGE (OpenGL REQUIRED)
|
|
|
|
FIND_PACKAGE (Threads REQUIRED)
|
|
|
|
|
|
|
|
INCLUDE_DIRECTORIES (
|
|
|
|
3rdparty/glfw/deps
|
2016-10-21 22:22:19 +02:00
|
|
|
3rdparty/glfw/include
|
2016-08-29 22:31:11 +02:00
|
|
|
3rdparty/bx/include
|
|
|
|
3rdparty/bgfx/include
|
|
|
|
3rdparty/bgfx/examples/common
|
|
|
|
3rdparty/bgfx/examples/common/entry
|
|
|
|
3rdparty/bgfx/3rdparty
|
|
|
|
3rdparty/tinyobjloader
|
|
|
|
3rdparty/bgfx/3rdparty/glsl-optimizer/include/
|
|
|
|
3rdparty/bgfx/3rdparty/glsl-optimizer/src/
|
|
|
|
3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/src
|
|
|
|
)
|
|
|
|
|
|
|
|
SUBDIRS (
|
2016-09-23 09:06:46 +02:00
|
|
|
src/modules
|
2017-01-03 22:47:17 +01:00
|
|
|
tests/
|
|
|
|
|
2016-08-29 22:31:11 +02:00
|
|
|
3rdparty/glfw
|
|
|
|
3rdparty/bgfx
|
2017-02-22 21:35:14 +01:00
|
|
|
3rdparty/rbdl
|
2017-01-03 22:47:17 +01:00
|
|
|
3rdparty/googletest
|
2016-08-29 22:31:11 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
SET ( protot_SRCS
|
|
|
|
src/shaderc_compile.cpp
|
|
|
|
src/shaderc_glsl.cpp
|
|
|
|
src/shaderc_hlsl.cpp
|
|
|
|
|
2016-09-16 17:29:17 +02:00
|
|
|
src/RuntimeModuleManager.cc
|
2016-08-31 22:35:33 +02:00
|
|
|
|
2016-08-29 22:31:11 +02:00
|
|
|
3rdparty/glfw/deps/glad.c
|
|
|
|
)
|
|
|
|
|
2016-09-03 19:48:24 +02:00
|
|
|
SET (PROTOT_SOURCE_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
|
|
|
CONFIGURE_FILE (
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/protot_config.h.cmake"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/src/protot_config.h"
|
|
|
|
)
|
|
|
|
|
2016-08-31 19:30:31 +02:00
|
|
|
ADD_EXECUTABLE (protot src/main.cc ${protot_SRCS})
|
2016-08-29 22:31:11 +02:00
|
|
|
|
|
|
|
file(GLOB glcpp-library_sources
|
|
|
|
3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/main/*.c
|
|
|
|
3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/program/*.c
|
|
|
|
3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/*.c
|
|
|
|
3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/*.cpp
|
|
|
|
3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/*.c
|
|
|
|
3rdparty/bgfx/3rdparty/glsl-optimizer/src/util/*.c
|
|
|
|
)
|
|
|
|
|
|
|
|
list(REMOVE_ITEM glcpp-library_sources ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/main.cpp)
|
|
|
|
|
|
|
|
ADD_LIBRARY (glsl-optimizer
|
|
|
|
${glcpp-library_sources}
|
|
|
|
|
|
|
|
3rdparty/bgfx/3rdparty/fcpp/cpp1.c
|
|
|
|
3rdparty/bgfx/3rdparty/fcpp/cpp2.c
|
|
|
|
3rdparty/bgfx/3rdparty/fcpp/cpp3.c
|
|
|
|
3rdparty/bgfx/3rdparty/fcpp/cpp4.c
|
|
|
|
3rdparty/bgfx/3rdparty/fcpp/cpp5.c
|
|
|
|
3rdparty/bgfx/3rdparty/fcpp/cpp6.c
|
|
|
|
)
|
|
|
|
|
|
|
|
SET_TARGET_PROPERTIES ( ${PROJECT_EXECUTABLES} PROPERTIES
|
|
|
|
LINKER_LANGUAGE CXX
|
|
|
|
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib"
|
|
|
|
)
|
|
|
|
|
|
|
|
SET_TARGET_PROPERTIES ( glsl-optimizer PROPERTIES
|
|
|
|
COMPILE_FLAGS "-fno-strict-aliasing"
|
|
|
|
)
|
|
|
|
|
|
|
|
MESSAGE (STATUS "glfw libraries: ${X11_X11_LIB}")
|
|
|
|
|
|
|
|
SET (glfw_dependencies
|
|
|
|
${X11_X11_LIB}
|
|
|
|
${X11_Xrandr_LIB}
|
|
|
|
${X11_Xinerama_LIB}
|
|
|
|
${X11_Xinput_LIB}
|
|
|
|
${X11_Xcursor_LIB}
|
|
|
|
${X11_Xxf86vm_LIB}
|
|
|
|
${CMAKE_DL_LIBS}
|
|
|
|
${CMAKE_THREAD_LIBS_INIT}
|
|
|
|
)
|
|
|
|
|
2016-08-31 19:30:31 +02:00
|
|
|
TARGET_LINK_LIBRARIES ( protot
|
2016-08-29 22:31:11 +02:00
|
|
|
glfw
|
|
|
|
${glfw_dependencies}
|
|
|
|
${OPENGL_LIBRARIES}
|
|
|
|
bgfx
|
|
|
|
bgfx_aux
|
|
|
|
glsl-optimizer
|
2017-02-22 21:35:14 +01:00
|
|
|
rbdl
|
|
|
|
rbdl_luamodel
|
2016-08-29 22:31:11 +02:00
|
|
|
)
|