Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cmake to support win builds #83

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 5 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.0)

project(carve)

set(CMAKE_MACOSX_RPATH 1)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

set(carve_VERSION_MAJOR 2)
set(carve_VERSION_MINOR 0)
set(carve_VERSION_PATCH 0a)
Expand All @@ -15,7 +10,6 @@ set(CARVE_VERSION ${carve_VERSION_MAJOR}.${carve_VERSION_MINOR}.${carve_VERSION_
option(BUILD_COVERAGE "Compile with gcov" OFF)
option(BUILD_SHARED_LIBS "Compile libcarve as shared" ON)
option(CARVE_WITH_GUI "Compile gui code" OFF)
option(CARVE_SYSTEM_BOOST "Compile with system installed boost" ON)
option(CARVE_BOOST_COLLECTIONS "Compile with boost collections" ON)
option(CARVE_DEBUG "Compile in debug code" OFF)
option(CARVE_DEBUG_WRITE_PLY_DATA "Write geometry output during debug" OFF)
Expand Down Expand Up @@ -53,7 +47,6 @@ if (BUILD_COVERAGE)
endif(BUILD_COVERAGE)

if(WIN32)
set(BUILD_SHARED_LIBS OFF) # until everything is exported
add_definitions(-D_USE_MATH_DEFINES)
add_definitions(-DNOMINMAX)
endif(WIN32)
Expand All @@ -71,18 +64,12 @@ set(HAVE_LIBSTDCPP_UNORDERED_COLLECTIONS FALSE)

set(HAVE_BOOST_UNORDERED_COLLECTIONS FALSE)

if(CARVE_SYSTEM_BOOST)
find_package(Boost 1.40)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
message(STATUS "Using system boost")
else(Boost_FOUND)
set(CARVE_SYSTEM_BOOST OFF)
endif(Boost_FOUND)
endif(CARVE_SYSTEM_BOOST)


if(CARVE_BOOST_COLLECTIONS)
set(HAVE_BOOST_UNORDERED_COLLECTIONS TRUE)
find_package(Boost 1.40)
include_directories(${Boost_INCLUDE_DIRS})
set(HAVE_BOOST_UNORDERED_COLLECTIONS TRUE)

else(CARVE_BOOST_COLLECTIONS)
# attempt to work out which unordered collection implementation we can use
Expand Down
2 changes: 1 addition & 1 deletion external/GLEW/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.0)

project(glew)

Expand Down
2 changes: 1 addition & 1 deletion external/GLOOP/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.0)

project(gloop)

Expand Down
12 changes: 0 additions & 12 deletions external/GLOOP/include/gloop/image/radiance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,7 @@

#pragma once

#if (defined WIN32) || (defined _WIN32)
typedef char int8_t;
typedef short int16_t;
typedef long int32_t;

typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned long uint32_t;
#else
#include <stdint.h>
#endif


#include <algorithm>
#include <istream>
#include <vector>
Expand Down
17 changes: 0 additions & 17 deletions external/GLOOP/include/gloop/model/stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,8 @@

#include <gloop/exceptions.hpp>
#include <gloop/ref.hpp>

#ifdef WIN32

typedef char int8_t;
typedef short int16_t;
typedef long int32_t;

typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned long uint32_t;

#else

#include <stdint.h>

#endif

#include <stdlib.h>

#include <string>
#include <list>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion external/GLOOP/src/model/obj_format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include <gloop/gloop.hpp>
#include <gloop/gloop-model.hpp>

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <iterator>
Expand Down
14 changes: 0 additions & 14 deletions external/GLOOP/src/model/ply_format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,9 @@
#include <iostream>
#include <stdarg.h>
#include <stdio.h>

#ifdef WIN32

typedef char int8_t;
typedef short int16_t;
typedef long int32_t;

typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned long uint32_t;

#else

#include <stdint.h>
#include <cstring>

#endif

namespace {

Expand Down
2 changes: 1 addition & 1 deletion external/GLUI/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.0)

find_package(OpenGL)
find_package(GLUT)
Expand Down
2 changes: 1 addition & 1 deletion external/gtest-1.5.0/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ endif()
# ${gtest_BINARY_DIR}.
# Language "C" is required for find_package(Threads).
project(gtest CXX C)
cmake_minimum_required(VERSION 2.6.4)
cmake_minimum_required(VERSION 3.0)

if (MSVC)
# For MSVC, CMake sets certain flags to defaults we want to override.
Expand Down
24 changes: 6 additions & 18 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
if(CARVE_SYSTEM_BOOST)
install(DIRECTORY carve
DESTINATION "${CMAKE_INSTALL_PREFIX}/include"
FILES_MATCHING
PATTERN "*.hpp"
PATTERN "*.h"
PATTERN "internal" EXCLUDE
REGEX "external/boost" EXCLUDE
)
else(CARVE_SYSTEM_BOOST)
install(DIRECTORY carve
DESTINATION "${CMAKE_INSTALL_PREFIX}/include"
FILES_MATCHING
PATTERN "*.hpp"
PATTERN "*.h"
PATTERN "internal" EXCLUDE
)
endif(CARVE_SYSTEM_BOOST)
install(DIRECTORY carve
DESTINATION "${CMAKE_INSTALL_PREFIX}/include"
FILES_MATCHING
PATTERN "*.hpp"
PATTERN "*.h"
)
2 changes: 1 addition & 1 deletion include/carve/aabb_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <carve/geom3d.hpp>

#include <carve/geom.hpp>

#include <algorithm>
#include <vector>

namespace carve {
Expand Down
8 changes: 4 additions & 4 deletions include/carve/carve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,8 @@
# include <carve/gnu_cxx.h>
#endif

#if defined(CARVE_SYSTEM_BOOST)
# define BOOST_INCLUDE(x) <boost/x>
#else
# define BOOST_INCLUDE(x) <carve/external/boost/x>
#endif


#include <math.h>

Expand All @@ -62,6 +59,9 @@
*/
namespace carve {
static struct noinit_t {} NOINIT;
#if defined(WIN32)
typedef ptrdiff_t ssize_t;
#endif defined(WIN32)

inline std::string fmtstring(const char *fmt, ...);

Expand Down
2 changes: 1 addition & 1 deletion include/carve/collection_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#pragma once

#include <carve/carve.hpp>

#include <algorithm>
#include <carve/mesh.hpp>

namespace carve {
Expand Down
30 changes: 0 additions & 30 deletions include/carve/external/README.BOOST

This file was deleted.

Loading