From ad874a9204d05740bb7bc211a4eceaf991e4f473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20F=C3=BCndgens?= Date: Fri, 21 Nov 2014 16:07:13 +0100 Subject: [PATCH] Modifying CMakes files to get convert to compile. --- CMakeLists.txt | 21 +++++-------- converter/CMakeLists.txt | 44 +++++++++++++++++++++++++++ converter/{lodepng.cpp => lodepng.cc} | 4 +-- converter/{lodepng.h => lodepng.hh} | 0 converter/main.cc | 2 +- 5 files changed, 54 insertions(+), 17 deletions(-) create mode 100644 converter/CMakeLists.txt rename converter/{lodepng.cpp => lodepng.cc} (99%) rename converter/{lodepng.h => lodepng.hh} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 73b043a..c1a055e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ CMAKE_MINIMUM_REQUIRED (VERSION 2.6) +add_subdirectory(converter) + # project/binary name: PROJECT(MarbleRaceGroupC) @@ -55,19 +57,17 @@ set(dir ${CMAKE_CURRENT_SOURCE_DIR}/binaries) set(EXECUTABLE_OUTPUT_PATH ${dir} CACHE PATH "Build directory" FORCE) # source and header files -FILE(GLOB_RECURSE SOURCE_FILES_SHARED "../shared/*.cc") -FILE(GLOB_RECURSE SOURCE_FILES "${CMAKE_SOURCE_DIR}/*.cc") +FILE(GLOB SOURCE_FILES "${CMAKE_SOURCE_DIR}/*.cc") SET(SOURCE_FILES ${SOURCE_FILES} ${SOURCE_FILES_SHARED}) -FILE(GLOB_RECURSE HEADER_FILES_SHARED "../shared/*.hh") -FILE(GLOB_RECURSE HEADER_FILES "${CMAKE_SOURCE_DIR}/*.hh") +FILE(GLOB HEADER_FILES "${CMAKE_SOURCE_DIR}/*.hh") SET(HEADER_FILES ${HEADER_FILES} ${HEADER_FILES_SHARED}) # shader files FILE(GLOB_RECURSE SHADER_FILES "${CMAKE_SOURCE_DIR}/Shader/*.*") # Readme -FILE(GLOB_RECURSE README_FILES "${CMAKE_SOURCE_DIR}/../README.TXT") +FILE(GLOB_RECURSE README_FILES "${CMAKE_SOURCE_DIR}/../Readme.md") # # ############################################################################### @@ -125,12 +125,5 @@ SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/bullet/build/src/LinearMa SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/bullet/build/src/BulletSoftBody/libBulletSoftBody.a) -ADD_EXECUTABLE(${CMAKE_PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES} ${SHADER_FILES} ${README_FILES}) -TARGET_LINK_LIBRARIES(${CMAKE_PROJECT_NAME} ${LIBRARIES}) - -FILE(GLOB_RECURSE SOURCE_FILES_CONV "${CMAKE_SOURCE_DIR}/converter/*.cc") -SET(SOURCE_FILES_CONV ${SOURCE_FILES_CONV}) - -FILE(GLOB_RECURSE HEADER_FILES_CONV "${CMAKE_SOURCE_DIR}/converter/*.hh") -SET(HEADER_FILES_CONV ${HEADER_FILES}) -ADD_EXECUTABLE(converter ${SOURCE_FILES_CONV} ${HEADER_FILES_CONV}) +ADD_EXECUTABLE(MarbleRaceGroupC ${SOURCE_FILES} ${HEADER_FILES} ${SHADER_FILES} ${README_FILES}) +TARGET_LINK_LIBRARIES(MarbleRaceGroupC ${LIBRARIES}) diff --git a/converter/CMakeLists.txt b/converter/CMakeLists.txt new file mode 100644 index 0000000..ab3a730 --- /dev/null +++ b/converter/CMakeLists.txt @@ -0,0 +1,44 @@ +CMAKE_MINIMUM_REQUIRED (VERSION 2.6) + +PROJECT(Converter) + +############################################################################### +# +# Compiler settings, can be simpler if only one compiler should be used. +# + +#Enable c++11 +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + #on clang we need to find out the version to set stdlib if needed + # if clang version is less than 3.3 ( XCode 5.0) you need to set the stdlib + #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") + MESSAGE("Clangversion ${CLANG_VERSION_STRING}") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + # using Visual Studio C++ +endif() + +# enable warnings +IF(MSVC) +# for msvc also set multiple processors +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /W3") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP /W3") +ELSE(MSVC) +ADD_DEFINITIONS(-Wall) +ENDIF(MSVC) +ADD_DEFINITIONS(-DNO_SPACE_NAVIGATOR_SUPPORT) + +# +# +############################################################################### + +FILE(GLOB_RECURSE SOURCE_FILES_CONV "${CMAKE_SOURCE_DIR}/converter/*.cc") +SET(SOURCE_FILES_CONV ${SOURCE_FILES_CONV}) + +FILE(GLOB_RECURSE HEADER_FILES_CONV "${CMAKE_SOURCE_DIR}/converter/*.hh") +SET(HEADER_FILES_CONV ${HEADER_FILES}) +ADD_EXECUTABLE(converter ${SOURCE_FILES_CONV} ${HEADER_FILES_CONV}) diff --git a/converter/lodepng.cpp b/converter/lodepng.cc similarity index 99% rename from converter/lodepng.cpp rename to converter/lodepng.cc index 31f146d..bc3c340 100644 --- a/converter/lodepng.cpp +++ b/converter/lodepng.cc @@ -24,11 +24,11 @@ freely, subject to the following restrictions: */ /* -The manual and changelog are in the header file "lodepng.h" +The manual and changelog are in the header file "lodepng.hh" Rename this file to lodepng.cpp to use it for C++, or to lodepng.c to use it for C. */ -#include "lodepng.h" +#include "lodepng.hh" #include #include diff --git a/converter/lodepng.h b/converter/lodepng.hh similarity index 100% rename from converter/lodepng.h rename to converter/lodepng.hh diff --git a/converter/main.cc b/converter/main.cc index 7f621f3..cd23435 100644 --- a/converter/main.cc +++ b/converter/main.cc @@ -1,4 +1,4 @@ -#include "lodepng.h" +#include "lodepng.hh" #include #include "converter.hh" #include