Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a6699df
Add @naraku9333's CMakeLists.txt from #41
LB-- Jun 4, 2013
d654311
Fix CMakeLists.txt to have proper include paths
LB-- Jun 4, 2013
d33e72b
Merge remote-tracking branch 'upstream/master' into cmake
LB-- Jun 4, 2013
1349872
Allow overriding library paths for cmake
LB-- Jun 5, 2013
2e4bf3e
Fix wrong boost include path
LB-- Jun 5, 2013
ca88c64
Merge branch 'master' into cmake
LB-- Sep 27, 2013
b7f7ffa
Remove reference to boost submodule
LB-- Sep 27, 2013
4796666
Update CMakeLists.txt add FindSFML.cmake
naraku9333 Sep 28, 2013
8d6e0fe
Timestamps will appear as 01:02:03 instead of 1:2:3
Oct 8, 2013
695c40c
Revert "Timestamps will appear as 01:02:03 instead of 1:2:3"
LB-- Oct 8, 2013
418ad93
fix timestamps and prevent variable shadowing inside constructor
MiiNiPaa Oct 8, 2013
f21fc61
Timestamps appear as 01:02:03 instead of 1:2:3. Uses std::put_time
Oct 8, 2013
1e17193
Merge pull request #47 from cpluspluscom/fix-log-times
LB-- Oct 8, 2013
defbcf5
Use work-around for incomplete standard libraries
LB-- Oct 8, 2013
1b5678d
Fix reversed macro logic
LB-- Oct 8, 2013
531765f
Fix error when __GNUC__ is not defined
LB-- Oct 8, 2013
8d50698
Prefer std solutuon with boost alternative
LB-- Oct 8, 2013
26b9de0
Fix behavior of USE_STD_PUT_TIME macro
LB-- Oct 8, 2013
b8ad03b
Fix typo
LB-- Oct 8, 2013
640e8f7
Qualify boost name
LB-- Oct 8, 2013
d0ec40f
CMakeLists.txt tweaks for OS x and Clang. list(append...) will not al…
Oct 9, 2013
b29eba8
CMakeLists.txt comments
Oct 9, 2013
c513e1c
For some reason Clang does not support std::ostream operator bool. Wo…
Oct 9, 2013
c9ff1ac
Use libc++ only on apple machines.
Oct 9, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@

# ChessPlusPlus
#
# Configuration options:
# -DCMAKE_BUILD_TYPE=Release|Debug
# -DSTATIC_BUILD=1|0

cmake_minimum_required (VERSION 2.8)

project (CHESSPP)

#Set options
if(WIN32)
set(SFML_ROOT "" CACHE PATH "Path to SFML root directory")
set(BOOST_ROOT "" CACHE PATH "Path to Boost root directory")
set(STATIC_BUILD TRUE CACHE BOOL "Link SFML statically") #option(STATIC_BUILD "Link statically" FALSE)
endif()

#Add json-parser
if(NOT JSONLIB)
set(JSONLIB ${CHESSPP_SOURCE_DIR}/lib/json-parser)
endif()
include_directories (${JSONLIB})

#Get all source files
file(GLOB_RECURSE CHESSPP_SOURCES "src/*.cpp")
file(GLOB_RECURSE CHESSPP_HEADERS "src/*.hpp")
list(APPEND CHESSPP_SOURCES "lib/json-parser/json.c")

set (CHESSPP_INCLUDE_DIRS "")
foreach (_headerFile ${CHESSPP_HEADERS})
get_filename_component(_dir ${_headerFile} PATH)
list (APPEND CHESSPP_INCLUDE_DIRS ${_dir})
endforeach()
list(REMOVE_DUPLICATES CHESSPP_INCLUDE_DIRS)
include_directories(${CHESSPP_INCLUDE_DIRS})

# Add C++11 definitions -- list(append...) will not always work.
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if(APPLE)
# Building with Clang (on OS x at least) requires -stdlib=libc++ flag
set(CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}")
endif()
endif()

# Detect and add SFML
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH})
if(STATIC_BUILD)
set(SFML_STATIC_LIBRARIES TRUE)
else()
set(SFML_STATIC_LIBRARIES FALSE)
endif()
find_package(SFML 2 REQUIRED graphics window network system audio)
include_directories (${SFML_INCLUDE_DIR})
link_directories(${SFML_ROOT}/lib)

#Detect Boost
find_package(Boost 1.54.0 COMPONENTS filesystem system REQUIRED)
include_directories(${BOOST_ROOT})
set(Boost_LIBRARYDIR ${BOOST_ROOT}/lib)
link_directories(${Boost_LIBRARY_DIR})

#Set static runtime for msvc
if(WIN32)
if(MSVC AND STATIC_BUILD)
foreach(flag
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag} "${${flag}}")
endif()
endforeach()
endif()
endif()

add_executable (chesspp ${CHESSPP_SOURCES})
target_link_libraries(chesspp ${SFML_LIBRARIES} ${Boost_LIBRARIES})
74 changes: 0 additions & 74 deletions Makefile

This file was deleted.

76 changes: 0 additions & 76 deletions Makefile.Lowest0ne

This file was deleted.

2 changes: 0 additions & 2 deletions build_clang_win.bat

This file was deleted.

Loading