Fix issues in CMakeLists files for Windows

This commit is contained in:
Daniel Chappuis 2016-03-03 17:25:53 +01:00
parent 97436877fb
commit 7d0b5df216
3 changed files with 19 additions and 12 deletions

View File

@ -1,8 +1,8 @@
# Minimum cmake version required # Minimum cmake version required
CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0 FATAL_ERROR) CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
# Project configuration # Project configuration
PROJECT(REACTPHYSICS3D) PROJECT(REACTPHYSICS3D CXX)
# Build type # Build type
IF (NOT CMAKE_BUILD_TYPE) IF (NOT CMAKE_BUILD_TYPE)
@ -24,8 +24,19 @@ OPTION(PROFILING_ENABLED "Select this if you want to compile with enabled profil
OPTION(DOUBLE_PRECISION_ENABLED "Select this if you want to compile using double precision floating OPTION(DOUBLE_PRECISION_ENABLED "Select this if you want to compile using double precision floating
values" OFF) values" OFF)
# Compiler flags # Warning Compiler flags
set(CMAKE_CXX_FLAGS "-Wall") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
# C++11 flags
IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
IF(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ELSE()
message("The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
ENDIF()
ENDIF()
# Headers # Headers
INCLUDE_DIRECTORIES(src) INCLUDE_DIRECTORIES(src)
@ -171,10 +182,6 @@ SET (REACTPHYSICS3D_SOURCES
# Create the library # Create the library
ADD_LIBRARY(reactphysics3d STATIC ${REACTPHYSICS3D_SOURCES}) ADD_LIBRARY(reactphysics3d STATIC ${REACTPHYSICS3D_SOURCES})
# Enable C++11 features
set_property(TARGET reactphysics3d PROPERTY CXX_STANDARD 11)
set_property(TARGET reactphysics3d PROPERTY CXX_STANDARD_REQUIRED ON)
# If we need to compile the testbed application # If we need to compile the testbed application
IF(COMPILE_TESTBED) IF(COMPILE_TESTBED)
add_subdirectory(testbed/) add_subdirectory(testbed/)

View File

@ -19,7 +19,7 @@ FILE(COPY "shaders/" DESTINATION "${EXECUTABLE_OUTPUT_PATH}/shaders/")
FILE(COPY "meshes/" DESTINATION "${EXECUTABLE_OUTPUT_PATH}/meshes/") FILE(COPY "meshes/" DESTINATION "${EXECUTABLE_OUTPUT_PATH}/meshes/")
# Headers # Headers
INCLUDE_DIRECTORIES("src/" "glew/include/" "nanogui/ext/glfw/include/" "nanogui/include/" "nanogui/ext/nanovg/src/" "nanogui/ext/eigen/" "opengl-framework/src/" "common/" "scenes/") INCLUDE_DIRECTORIES("src/" "glew/include/" "nanogui/ext/glfw/include/" "nanogui/ext/glew/include/" "nanogui/include/" "nanogui/ext/nanovg/src/" "nanogui/ext/eigen/" "opengl-framework/src/" "common/" "scenes/")
# OpenGLFramework source files # OpenGLFramework source files
SET(OPENGLFRAMEWORK_SOURCES SET(OPENGLFRAMEWORK_SOURCES

View File

@ -99,9 +99,9 @@ endif()
if(WIN32) if(WIN32)
# Build and include GLEW on Windows # Build and include GLEW on Windows
#list(APPEND LIBNANOGUI_EXTRA_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/ext/glew/src/glew.c") list(APPEND LIBNANOGUI_EXTRA_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/ext/glew/src/glew.c")
#set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/ext/glew/src/glew.c" PROPERTIES COMPILE_DEFINITIONS GLEW_BUILD) set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/ext/glew/src/glew.c" PROPERTIES COMPILE_DEFINITIONS GLEW_BUILD)
#include_directories(ext/glew/include) include_directories(ext/glew/include)
endif() endif()
# Required core libraries on various platforms # Required core libraries on various platforms