Skip to content

Commit b094f81

Browse files
author
ifilot
committed
Changing build system to CMake
1 parent 9ff4d0c commit b094f81

Some content is hidden

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

42 files changed

+727
-983
lines changed

.gitignore

+3-23
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,6 @@
1818
# Autotools
1919
src/.deps
2020

21-
# integration with travis
22-
.deps
23-
.dirstamp
24-
.libs
25-
/aclocal.m4
26-
/autom4te.cache
27-
/config.guess
28-
/config.h
29-
/config.log
30-
/config.status
31-
/config.sub
32-
/libtool
33-
/stamp-h1
34-
INSTALL
35-
Makefile
36-
Makefile.in
37-
config.h.in
38-
configure
39-
depcomp
40-
install-sh
41-
missing
42-
4321
# Executable
4422
hfcxx
4523

@@ -51,4 +29,6 @@ hfcxx
5129
*.am~
5230

5331
compile
54-
test-driver
32+
test-driver
33+
build/*
34+
!empty

.travis.yml

-18
This file was deleted.

Makefile.am

-4
This file was deleted.

TODO

-4
This file was deleted.

autogen.sh

-6
This file was deleted.

build/empty

Whitespace-only changes.

configure.ac

-27
This file was deleted.

src/CMakeLists.txt

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#*************************************************************************
2+
# CMakeLists.txt -- This file is part of Netris. *
3+
# *
4+
# Copyright (C) 2016, Ivo Filot *
5+
# *
6+
# Netris is free software: you can redistribute it and/or modify *
7+
# it under the terms of the GNU General Public License as published *
8+
# by the Free Software Foundation, either version 3 of the License, *
9+
# or (at your option) any later version. *
10+
# *
11+
# Netris is distributed in the hope that it will be useful, *
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty *
13+
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
14+
# See the GNU General Public License for more details. *
15+
# *
16+
# You should have received a copy of the GNU General Public License *
17+
# along with this program. If not, see http://www.gnu.org/licenses/. *
18+
# *
19+
#*************************************************************************/
20+
21+
# set minimum cmake requirements
22+
cmake_minimum_required(VERSION 2.8)
23+
project (hfcxx)
24+
25+
# add custom directory to look for .cmake files
26+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modules )
27+
28+
# Enable release build
29+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
30+
message(STATUS "Setting build type to 'Release' as none was specified.")
31+
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
32+
# Set the possible values of build type for cmake-gui
33+
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
34+
endif()
35+
36+
# Configure static build
37+
SET(BUILD_SHARED_LIBRARIES OFF)
38+
39+
IF(WIN32)
40+
SET(CMAKE_FIND_LIBRARY_PREFIXES "")
41+
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
42+
ELSE()
43+
SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
44+
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
45+
ENDIF()
46+
47+
# # add OS specific
48+
# if(APPLE)
49+
# add_definitions(-D_APPLE)
50+
# SET(BOOST_INCLUDEDIR "/opt/local/include")
51+
# SET(BOOST_LIBRARYDIR "/opt/local/lib")
52+
# endif()
53+
# if(UNIX)
54+
# add_definitions(-Wno-literal-suffix)
55+
# SET(BOOST_INCLUDEDIR "/usr/include")
56+
# SET(BOOST_LIBRARYDIR "/usr/lib/x86_64-linux-gnu")
57+
# endif()
58+
59+
# set Boost
60+
# set (Boost_NO_SYSTEM_PATHS ON)
61+
# set (Boost_USE_MULTITHREADED ON)
62+
# set (Boost_USE_STATIC_LIBS ON)
63+
# set (Boost_USE_STATIC_RUNTIME OFF)
64+
# set (BOOST_ALL_DYN_LINK OFF)
65+
66+
# Include libraries
67+
# find_package(TCLAP REQUIRED)
68+
# find_package(SUNDIALS REQUIRED)
69+
# find_package(Boost COMPONENTS system filesystem regex REQUIRED)
70+
# find_package(CPPUNIT REQUIRED) # for unit tests
71+
72+
# Set include folders
73+
include_directories(${CMAKE_CURRENT_SOURCE_DIR}
74+
${CMAKE_BINARY_DIR}
75+
${Boost_INCLUDE_DIRS}
76+
${TCLAP_INCLUDE_DIR}
77+
${SUNDIALS_INCLUDE_DIR}
78+
${CPPUNIT_INCLUDE_DIR})
79+
80+
# Add sources
81+
file(GLOB SOURCES "*.cpp")
82+
83+
# add tests
84+
# enable_testing ()
85+
# add_subdirectory("test")
86+
87+
# Set executable
88+
add_executable(hfcxx ${SOURCES})
89+
90+
# Link libraries
91+
target_link_libraries(hfcxx)
92+
93+
###
94+
# Installing
95+
##
96+
install (TARGETS hfcxx DESTINATION bin)

0 commit comments

Comments
 (0)