Skip to content

Commit

Permalink
Refactor (#4)
Browse files Browse the repository at this point in the history
* refactor lib and src

* fix build

* fix build
  • Loading branch information
chongyangma authored Apr 22, 2018
1 parent c59d3d2 commit adf6bbc
Show file tree
Hide file tree
Showing 58 changed files with 44 additions and 82 deletions.
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ build:
# verbosity: quiet

after_build:
- cd C:\projects\LevelSyn\build\Release
- levels.exe ..\..\data\planar_graph_fig1.xml ..\..\data\building_blocks_fig1.xml ..\..\data\config.txt 10
- cd C:\projects\LevelSyn\build\src\Release
- levels.exe ..\..\..\data\planar_graph_fig1.xml ..\..\..\data\building_blocks_fig1.xml ..\..\..\data\config.txt 10
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ before_script:

script:
- make
- ./levels ../data/planar_graph_fig1.xml ../data/building_blocks_fig1.xml ../data/config.txt 10
- ./src/levels ../data/planar_graph_fig1.xml ../data/building_blocks_fig1.xml ../data/config.txt 10
60 changes: 2 additions & 58 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,61 +1,5 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(LevelSyn)

if(MSVC)
# set( BOOST_ROOT "C:/Program Files/boost/boost_1_54_0")
# set( BOOST_LIBRARYDIR "C:/Program Files/boost/boost_1_54_0/lib64-msvc-10.0" )
endif()

SET(Boost_USE_STATIC_LIBS TRUE)
FIND_PACKAGE( Boost COMPONENTS thread REQUIRED )
LINK_DIRECTORIES ( ${Boost_LIBRARY_DIRS} )
INCLUDE_DIRECTORIES ( ${Boost_INCLUDE_DIRS} )

if(APPLE)
FIND_LIBRARY( coreFoundation CoreFoundation )
endif()

ADD_SUBDIRECTORY( tinyxml )
INCLUDE_DIRECTORIES ( tinyxml )
INCLUDE_DIRECTORIES ( clipper )

SET(SOURCES
clipper/clipper.cpp
code/PlanarGraph.cpp
code/Room.cpp
code/RoomTemplates.cpp
code/RoomLayout.cpp
code/LevelSynth.cpp
code/LevelConfig.cpp
code/LevelMath.cpp
code/clipperWrapper.cpp
code/ConfigSpace.cpp
)

SET(HEADERS
clipper/clipper.hpp
code/GraphChain.h
code/GraphEdge.h
code/GraphFace.h
code/GraphNode.h
code/LineBase.h
code/PlanarGraph.h
code/Room.h
code/RoomTemplates.h
code/RoomLayout.h
code/RoomEdge.h
code/LevelSynth.h
code/LevelConfig.h
code/LevelMath.h
code/LevelTimer.h
code/clipperWrapper.h
code/ConfigSpace.h
code/util.h
code/vec.h
)

ADD_EXECUTABLE( levels code/levels.cpp ${SOURCES} ${HEADERS} )
TARGET_LINK_LIBRARIES( levels tinyxml ${Boost_LIBRARIES} ${Boost_THREAD_LIBRARY} )
if(APPLE)
TARGET_LINK_LIBRARIES( levels ${coreFoundation} )
endif()
ADD_SUBDIRECTORY(lib)
ADD_SUBDIRECTORY(src)
21 changes: 0 additions & 21 deletions clipper/CMakeLists.txt

This file was deleted.

2 changes: 2 additions & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ADD_SUBDIRECTORY(clipper)
ADD_SUBDIRECTORY(tinyxml)
7 changes: 7 additions & 0 deletions lib/clipper/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
PROJECT(clipper)

FILE(GLOB CLIPPER_SOURCES *.cpp)
FILE(GLOB CLIPPER_HEADERS *.hpp)

ADD_LIBRARY(clipper STATIC ${CLIPPER_SOURCES} ${CLIPPER_HEADERS})
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.
File renamed without changes.
30 changes: 30 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(LevenSyn)

IF(MSVC)
# set( BOOST_ROOT "C:/Program Files/boost/boost_1_54_0")
# set( BOOST_LIBRARYDIR "C:/Program Files/boost/boost_1_54_0/lib64-msvc-10.0" )
ENDIF()

SET(Boost_USE_STATIC_LIBS TRUE)
FIND_PACKAGE(Boost COMPONENTS thread REQUIRED)
LINK_DIRECTORIES (${Boost_LIBRARY_DIRS})
INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIRS})

IF(APPLE)
FIND_LIBRARY(coreFoundation CoreFoundation)
ENDIF()

FILE(GLOB LEVEL_SYN_SOURCES "*.cpp")
FILE(GLOB LEVEL_SYN_HEADERS "*.h")

INCLUDE_DIRECTORIES (../lib/clipper)
INCLUDE_DIRECTORIES (../lib/tinyxml)

LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/../lib)

ADD_EXECUTABLE(levels ${LEVEL_SYN_SOURCES} ${LEVEL_SYN_HEADERS})
TARGET_LINK_LIBRARIES(levels tinyxml clipper ${Boost_LIBRARIES} ${Boost_THREAD_LIBRARY})
if(APPLE)
TARGET_LINK_LIBRARIES(levels ${coreFoundation})
endif()
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit adf6bbc

Please sign in to comment.