Modifying CMakes files to get convert to compile.

This commit is contained in:
Steffen Fündgens 2014-11-21 16:07:13 +01:00
parent 86c11e339e
commit c65a745603
5 changed files with 54 additions and 17 deletions

View File

@ -1,5 +1,7 @@
CMAKE_MINIMUM_REQUIRED (VERSION 2.6) CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
add_subdirectory(converter)
# project/binary name: # project/binary name:
PROJECT(MarbleRaceGroupC) PROJECT(MarbleRaceGroupC)
@ -55,19 +57,17 @@ set(dir ${CMAKE_CURRENT_SOURCE_DIR}/binaries)
set(EXECUTABLE_OUTPUT_PATH ${dir} CACHE PATH "Build directory" FORCE) set(EXECUTABLE_OUTPUT_PATH ${dir} CACHE PATH "Build directory" FORCE)
# source and header files # source and header files
FILE(GLOB_RECURSE SOURCE_FILES_SHARED "../shared/*.cc") FILE(GLOB SOURCE_FILES "${CMAKE_SOURCE_DIR}/*.cc")
FILE(GLOB_RECURSE SOURCE_FILES "${CMAKE_SOURCE_DIR}/*.cc")
SET(SOURCE_FILES ${SOURCE_FILES} ${SOURCE_FILES_SHARED}) SET(SOURCE_FILES ${SOURCE_FILES} ${SOURCE_FILES_SHARED})
FILE(GLOB_RECURSE HEADER_FILES_SHARED "../shared/*.hh") FILE(GLOB HEADER_FILES "${CMAKE_SOURCE_DIR}/*.hh")
FILE(GLOB_RECURSE HEADER_FILES "${CMAKE_SOURCE_DIR}/*.hh")
SET(HEADER_FILES ${HEADER_FILES} ${HEADER_FILES_SHARED}) SET(HEADER_FILES ${HEADER_FILES} ${HEADER_FILES_SHARED})
# shader files # shader files
FILE(GLOB_RECURSE SHADER_FILES "${CMAKE_SOURCE_DIR}/Shader/*.*") FILE(GLOB_RECURSE SHADER_FILES "${CMAKE_SOURCE_DIR}/Shader/*.*")
# Readme # 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) 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}) ADD_EXECUTABLE(MarbleRaceGroupC ${SOURCE_FILES} ${HEADER_FILES} ${SHADER_FILES} ${README_FILES})
TARGET_LINK_LIBRARIES(${CMAKE_PROJECT_NAME} ${LIBRARIES}) TARGET_LINK_LIBRARIES(MarbleRaceGroupC ${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})

44
converter/CMakeLists.txt Normal file
View File

@ -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})

View File

@ -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. 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 <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -1,4 +1,4 @@
#include "lodepng.h" #include "lodepng.hh"
#include <string> #include <string>
#include "converter.hh" #include "converter.hh"
#include <vector> #include <vector>