2016-07-31 11:56:30 +00:00
|
|
|
project(assimp_qt_viewer)
|
2016-07-31 12:14:49 +00:00
|
|
|
set(PROJECT_VERSION "")
|
2016-07-31 11:56:30 +00:00
|
|
|
|
|
|
|
cmake_minimum_required(VERSION 2.6)
|
|
|
|
|
2016-10-21 10:50:41 +00:00
|
|
|
find_package(Qt5Widgets REQUIRED)
|
2016-07-31 12:14:49 +00:00
|
|
|
find_package(DevIL REQUIRED)
|
2016-07-31 12:50:48 +00:00
|
|
|
find_package(OpenGL REQUIRED)
|
2016-07-31 11:56:30 +00:00
|
|
|
|
|
|
|
include_directories(
|
2016-10-21 10:50:41 +00:00
|
|
|
${Qt5Widgets_INCLUDES}
|
2016-07-31 11:56:30 +00:00
|
|
|
${Assimp_SOURCE_DIR}/include
|
|
|
|
${Assimp_SOURCE_DIR}/code
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${CMAKE_SOURCE_DIR}
|
2016-07-31 12:50:48 +00:00
|
|
|
${OPENGL_INCLUDE_DIR}
|
|
|
|
${IL_INCLUDE_DIR}
|
2016-07-31 11:56:30 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
link_directories(${Assimp_BINARY_DIR})
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pedantic -Wall")
|
|
|
|
|
|
|
|
set(assimp_qt_viewer_SRCS main.cpp loggerview.cpp glview.cpp mainwindow.cpp)
|
2016-10-21 10:50:41 +00:00
|
|
|
qt5_wrap_ui(UISrcs mainwindow.ui)
|
|
|
|
qt5_wrap_cpp(MOCrcs mainwindow.hpp glview.hpp)
|
2016-07-31 11:56:30 +00:00
|
|
|
|
|
|
|
add_executable(${PROJECT_NAME} ${assimp_qt_viewer_SRCS} ${UISrcs} ${MOCrcs})
|
2016-07-31 12:50:48 +00:00
|
|
|
target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${IL_LIBRARIES} ${OPENGL_LIBRARIES} assimp)
|
2016-07-31 11:56:30 +00:00
|
|
|
|
2016-10-21 10:50:41 +00:00
|
|
|
qt5_use_modules(${PROJECT_NAME} Widgets OpenGL)
|
2016-07-31 11:56:30 +00:00
|
|
|
if(WIN32) # Check if we are on Windows
|
|
|
|
if(MSVC) # Check if we are using the Visual Studio compiler
|
2016-10-21 10:50:41 +00:00
|
|
|
#set_target_properties(TestProject PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS")
|
2016-07-31 11:56:30 +00:00
|
|
|
elseif(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mwindows") # Not tested
|
|
|
|
else()
|
|
|
|
message(SEND_ERROR "You are using an unsupported Windows compiler! (Not MSVC or GCC)")
|
|
|
|
endif()
|
|
|
|
elseif(UNIX)
|
|
|
|
# Nothing special required
|
|
|
|
else()
|
|
|
|
message(SEND_ERROR "You are on an unsupported platform! (Not Win32 or Unix)")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set_property(TARGET ${PROJECT_NAME} PROPERTY DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
|