Skip to content

Commit adf6bbc

Browse files
authored
Refactor (#4)
* refactor lib and src * fix build * fix build
1 parent c59d3d2 commit adf6bbc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+44
-82
lines changed

.appveyor.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ build:
3939
# verbosity: quiet
4040

4141
after_build:
42-
- cd C:\projects\LevelSyn\build\Release
43-
- levels.exe ..\..\data\planar_graph_fig1.xml ..\..\data\building_blocks_fig1.xml ..\..\data\config.txt 10
42+
- cd C:\projects\LevelSyn\build\src\Release
43+
- levels.exe ..\..\..\data\planar_graph_fig1.xml ..\..\..\data\building_blocks_fig1.xml ..\..\..\data\config.txt 10

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ before_script:
2020

2121
script:
2222
- make
23-
- ./levels ../data/planar_graph_fig1.xml ../data/building_blocks_fig1.xml ../data/config.txt 10
23+
- ./src/levels ../data/planar_graph_fig1.xml ../data/building_blocks_fig1.xml ../data/config.txt 10

CMakeLists.txt

+2-58
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,5 @@
11
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
22
PROJECT(LevelSyn)
33

4-
if(MSVC)
5-
# set( BOOST_ROOT "C:/Program Files/boost/boost_1_54_0")
6-
# set( BOOST_LIBRARYDIR "C:/Program Files/boost/boost_1_54_0/lib64-msvc-10.0" )
7-
endif()
8-
9-
SET(Boost_USE_STATIC_LIBS TRUE)
10-
FIND_PACKAGE( Boost COMPONENTS thread REQUIRED )
11-
LINK_DIRECTORIES ( ${Boost_LIBRARY_DIRS} )
12-
INCLUDE_DIRECTORIES ( ${Boost_INCLUDE_DIRS} )
13-
14-
if(APPLE)
15-
FIND_LIBRARY( coreFoundation CoreFoundation )
16-
endif()
17-
18-
ADD_SUBDIRECTORY( tinyxml )
19-
INCLUDE_DIRECTORIES ( tinyxml )
20-
INCLUDE_DIRECTORIES ( clipper )
21-
22-
SET(SOURCES
23-
clipper/clipper.cpp
24-
code/PlanarGraph.cpp
25-
code/Room.cpp
26-
code/RoomTemplates.cpp
27-
code/RoomLayout.cpp
28-
code/LevelSynth.cpp
29-
code/LevelConfig.cpp
30-
code/LevelMath.cpp
31-
code/clipperWrapper.cpp
32-
code/ConfigSpace.cpp
33-
)
34-
35-
SET(HEADERS
36-
clipper/clipper.hpp
37-
code/GraphChain.h
38-
code/GraphEdge.h
39-
code/GraphFace.h
40-
code/GraphNode.h
41-
code/LineBase.h
42-
code/PlanarGraph.h
43-
code/Room.h
44-
code/RoomTemplates.h
45-
code/RoomLayout.h
46-
code/RoomEdge.h
47-
code/LevelSynth.h
48-
code/LevelConfig.h
49-
code/LevelMath.h
50-
code/LevelTimer.h
51-
code/clipperWrapper.h
52-
code/ConfigSpace.h
53-
code/util.h
54-
code/vec.h
55-
)
56-
57-
ADD_EXECUTABLE( levels code/levels.cpp ${SOURCES} ${HEADERS} )
58-
TARGET_LINK_LIBRARIES( levels tinyxml ${Boost_LIBRARIES} ${Boost_THREAD_LIBRARY} )
59-
if(APPLE)
60-
TARGET_LINK_LIBRARIES( levels ${coreFoundation} )
61-
endif()
4+
ADD_SUBDIRECTORY(lib)
5+
ADD_SUBDIRECTORY(src)

clipper/CMakeLists.txt

-21
This file was deleted.

lib/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ADD_SUBDIRECTORY(clipper)
2+
ADD_SUBDIRECTORY(tinyxml)

lib/clipper/CMakeLists.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
2+
PROJECT(clipper)
3+
4+
FILE(GLOB CLIPPER_SOURCES *.cpp)
5+
FILE(GLOB CLIPPER_HEADERS *.hpp)
6+
7+
ADD_LIBRARY(clipper STATIC ${CLIPPER_SOURCES} ${CLIPPER_HEADERS})
File renamed without changes.

clipper/README lib/clipper/README

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/CMakeLists.txt

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2+
PROJECT(LevenSyn)
3+
4+
IF(MSVC)
5+
# set( BOOST_ROOT "C:/Program Files/boost/boost_1_54_0")
6+
# set( BOOST_LIBRARYDIR "C:/Program Files/boost/boost_1_54_0/lib64-msvc-10.0" )
7+
ENDIF()
8+
9+
SET(Boost_USE_STATIC_LIBS TRUE)
10+
FIND_PACKAGE(Boost COMPONENTS thread REQUIRED)
11+
LINK_DIRECTORIES (${Boost_LIBRARY_DIRS})
12+
INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIRS})
13+
14+
IF(APPLE)
15+
FIND_LIBRARY(coreFoundation CoreFoundation)
16+
ENDIF()
17+
18+
FILE(GLOB LEVEL_SYN_SOURCES "*.cpp")
19+
FILE(GLOB LEVEL_SYN_HEADERS "*.h")
20+
21+
INCLUDE_DIRECTORIES (../lib/clipper)
22+
INCLUDE_DIRECTORIES (../lib/tinyxml)
23+
24+
LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/../lib)
25+
26+
ADD_EXECUTABLE(levels ${LEVEL_SYN_SOURCES} ${LEVEL_SYN_HEADERS})
27+
TARGET_LINK_LIBRARIES(levels tinyxml clipper ${Boost_LIBRARIES} ${Boost_THREAD_LIBRARY})
28+
if(APPLE)
29+
TARGET_LINK_LIBRARIES(levels ${coreFoundation})
30+
endif()
File renamed without changes.
File renamed without changes.

code/GraphChain.h src/GraphChain.h

File renamed without changes.

code/GraphEdge.h src/GraphEdge.h

File renamed without changes.

code/GraphFace.h src/GraphFace.h

File renamed without changes.

code/GraphNode.h src/GraphNode.h

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

code/LevelMath.h src/LevelMath.h

File renamed without changes.
File renamed without changes.

code/LevelSynth.h src/LevelSynth.h

File renamed without changes.

code/LevelTimer.h src/LevelTimer.h

File renamed without changes.

code/LineBase.h src/LineBase.h

File renamed without changes.
File renamed without changes.
File renamed without changes.

code/Room.cpp src/Room.cpp

File renamed without changes.

code/Room.h src/Room.h

File renamed without changes.

code/RoomEdge.h src/RoomEdge.h

File renamed without changes.
File renamed without changes.

code/RoomLayout.h src/RoomLayout.h

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

code/levels.cpp src/levels.cpp

File renamed without changes.

code/util.h src/util.h

File renamed without changes.

code/vec.h src/vec.h

File renamed without changes.

0 commit comments

Comments
 (0)