Skip to content

Commit fd32278

Browse files
author
Philipp Reh
committed
Search for fcppt, mizuiro and sge.
1 parent 8242eb7 commit fd32278

File tree

4 files changed

+171
-20
lines changed

4 files changed

+171
-20
lines changed

CMakeLists.txt

+41-20
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,70 @@
11
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
22

3-
PROJECT (load_image_to_array)
3+
PROJECT (insula)
4+
5+
SET (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules)
46

57
SET (CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
68

79
IF(${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
810
message(FATAL_ERROR "In-source builds are not permitted. Make a separate folder for building:\nmkdir build; cd build; cmake ..\nBefore that, remove the files that cmake just created:\nrm -rf CMakeCache.txt CMakeFiles")
911
ENDIF()
1012

11-
INCLUDE (FindPkgConfig)
12-
1313
OPTION(ENABLE_OPTIMIZATIONS "Enable -O3" ON)
1414

1515
#SET (CMAKE_VERBOSE_MAKEFILE ON)
1616

17-
SET (Boost_ADDITIONAL_VERSIONS "1.44.0")
17+
SET (Boost_ADDITIONAL_VERSIONS "1.44.0" "1.44")
1818

1919
IF(MSVC)
2020
SET(Boost_USE_STATIC_LIBS ON)
2121
ENDIF()
2222

2323
FIND_PACKAGE(
2424
Boost 1.44.0 REQUIRED COMPONENTS
25-
iostreams
2625
program_options
27-
system
28-
thread
2926
)
3027

3128
INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIR})
29+
3230
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
33-
PKG_CHECK_MODULES(SGE spacegameengine)
34-
LINK_DIRECTORIES(${SGE_LIBRARY_DIRS})
31+
32+
FIND_PACKAGE(
33+
Fcppt REQUIRED
34+
)
35+
36+
INCLUDE_DIRECTORIES(${FCPPT_INCLUDE_DIRS})
37+
38+
LINK_DIRECTORIES(${FCPPT_LIBRARY_DIR})
39+
40+
FIND_PACKAGE(
41+
Mizuiro REQUIRED
42+
)
43+
44+
INCLUDE_DIRECTORIES(${MIZUIRO_INCLUDE_DIRS})
45+
46+
FIND_PACKAGE(
47+
SGE REQUIRED
48+
)
49+
50+
INCLUDE_DIRECTORIES(${SGE_INCLUDE_DIRS})
3551

3652
IF (${CMAKE_COMPILER_IS_GNUCXX})
37-
ADD_DEFINITIONS("-fvisibility=hidden -ansi -pedantic-errors -Wall"
38-
"-Wextra -Wconversion -Wfloat-equal -Wredundant-decls"
39-
"-Wstrict-null-sentinel -Winit-self -Woverloaded-virtual"
40-
"-Wold-style-cast -Wnon-virtual-dtor -Wctor-dtor-privacy -Wsign-promo"
41-
"-Wstrict-aliasing=1 -Wmissing-declarations -Wno-long-long"
42-
"-ggdb"
43-
"-std=c++0x")
53+
ADD_DEFINITIONS("
54+
-fvisibility=hidden -std=c++0x -pedantic-errors -Wall"
55+
"-Wextra -Wconversion -Wfloat-equal -Wredundant-decls"
56+
"-Wstrict-null-sentinel -Winit-self -Woverloaded-virtual"
57+
"-Wold-style-cast -Wnon-virtual-dtor -Wctor-dtor-privacy -Wsign-promo"
58+
"-Wstrict-aliasing=1 -Wmissing-declarations"
59+
)
4460

4561
IF (ENABLE_OPTIMIZATIONS)
4662
ADD_DEFINITIONS("-O3")
4763
ENDIF()
48-
# we don't use long long but boost does :(
4964

50-
ADD_DEFINITIONS(-D BOOST_FILESYSTEM_NO_DEPRECATED)
5165
ADD_DEFINITIONS(-D BOOST_HAS_GCC_TR1)
5266
ELSEIF (MSVC)
53-
ADD_DEFINITIONS ("/W3 /wd4512 /wd4355 /wd4800 /wd4996 /wd4714 /EHa /D_BIND_TO_CURRENT_VCLIBS_VERSION=1")
67+
ADD_DEFINITIONS ("/W4 /wd4996 /EHa /D_BIND_TO_CURRENT_VCLIBS_VERSION=1")
5468
ENDIF ()
5569

5670
ADD_DEFINITIONS(${SGE_CFLAGS})
@@ -90,7 +104,14 @@ ADD_LIBRARY(insula_library STATIC ${base_files} ${texture_files} ${console_files
90104

91105
FUNCTION(CREATE_INSULA_EXE name)
92106
ADD_EXECUTABLE(${name} ${name}.cpp)
93-
TARGET_LINK_LIBRARIES(${name} insula_library fcppt sgecore ${Boost_LIBRARIES} ${BULLET_LIBRARIES})
107+
TARGET_LINK_LIBRARIES(
108+
${name}
109+
insula_library
110+
${FCPPT_LIBRARIES}
111+
${SGE_CORE_LIBRARY}
112+
${Boost_LIBRARIES}
113+
${BULLET_LIBRARIES}
114+
)
94115
ENDFUNCTION(CREATE_INSULA_EXE)
95116

96117
CREATE_INSULA_EXE(load_image_to_array)

CMakeModules/FindFcppt.cmake

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# - Try to find the fcppt library
2+
#
3+
# This module defines the following variables
4+
#
5+
# FCPPT_FOUND - True when fcppt was found
6+
# FCPPT_INCLUDE_DIRS - The path to the FCPPT header files
7+
# FCPPT_LIBRARY_DIRS - The path to the FCPPT library
8+
# FCPPT_LIBRARIES - The fcppt libraries
9+
# FCPPT_DEFINITIONS - Additional compiler flags required
10+
#
11+
# This modules accepts the following variables
12+
#
13+
# FCPPT_ROOT - can be set to the path containing the fcppt library files
14+
# this module will search in the standard include and library directories
15+
# and ${FCPPT_ROOT}/include for header files
16+
# ${FCPPT_ROOT}/lib for the library
17+
#
18+
# FCPPT_WANT_DYN_LINK - prefer a dynamic link over a static one when using VC++.
19+
# This will not be useful for any other system.
20+
21+
IF (NOT FCPPT_ROOT)
22+
SET( FCPPT_ROOT CACHE PATH "" )
23+
ENDIF ()
24+
25+
FIND_PATH( FCPPT_INCLUDE_DIRS
26+
NAMES fcppt/version.hpp
27+
HINTS ${FCPPT_ROOT}/include)
28+
29+
MACRO(FIND_FCPPT_LIBRARY name)
30+
FIND_LIBRARY(
31+
FCPPT_LIBRARIES
32+
NAMES ${name}
33+
HINTS ${FCPPT_ROOT}/lib
34+
)
35+
ENDMACRO()
36+
37+
IF(MSVC)
38+
IF(NOT FCPPT_WANT_DYN_LINK)
39+
FIND_FCPPT_LIBRARY(fcppt_static)
40+
ENDIF()
41+
42+
IF(NOT FCPPT_LIBRARIES)
43+
FIND_FCPPT_LIBRARY(fcppt)
44+
45+
SET (FCPPT_DEFINITIONS "/D FCPPT_DYN_LINK")
46+
ENDIF()
47+
ELSE()
48+
FIND_FCPPT_LIBRARY(fcppt)
49+
ENDIF()
50+
51+
IF (FCPPT_LIBRARIES)
52+
GET_FILENAME_COMPONENT( FCPPT_LIBRARY_DIRS ${FCPPT_LIBRARIES} PATH )
53+
ENDIF()
54+
55+
IF ((NOT FCPPT_INCLUDE_DIRS) AND (NOT FCPPT_LIBRARIES))
56+
MESSAGE("NOT FOUND! :(")
57+
INCLUDE (FindPkgConfig)
58+
pkg_check_modules(FCPPT fcppt)
59+
ENDIF()
60+
61+
INCLUDE(FindPackageHandleStandardArgs)
62+
FIND_PACKAGE_HANDLE_STANDARD_ARGS( FCPPT
63+
DEFAULT_MSG
64+
FCPPT_LIBRARIES
65+
FCPPT_INCLUDE_DIRS)
66+
67+
MARK_AS_ADVANCED(FCPPT_LIBRARIES FCPPT_LIBRARY_DIRS FCPPT_INCLUDE_DIRS)

CMakeModules/FindMizuiro.cmake

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# - Try to find the mizuiro library
2+
#
3+
# This module defines the following variables
4+
#
5+
# MIZUIRO_FOUND - True when mizuiro was found
6+
# MIZUIRO_INCLUDE_DIRS - The path to the MIZUIRO header files
7+
#
8+
# This modules accepts the following variables
9+
#
10+
# MIZUIRO_ROOT - can be set to the path containing the mizuiro library files
11+
# this module will search in the standard include
12+
# and ${MIZUIRO_ROOT}/include for header files
13+
#
14+
15+
FIND_PATH(
16+
MIZUIRO_INCLUDE_DIRS
17+
NAMES mizuiro/config.hpp
18+
HINTS ${MIZUIRO_ROOT}/include
19+
)

CMakeModules/FindSGE.cmake

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# - Try to find SGE
2+
#
3+
# This module defines the following variables
4+
#
5+
#
6+
# SGE_FOUND
7+
# SGE_INCLUDE_DIRS
8+
# SGE_CORE_LIBRARY
9+
# SGE_GUI_LIBRARY
10+
#
11+
12+
FIND_PATH(
13+
SGE_INCLUDE_DIRS
14+
NAMES sge/config.hpp
15+
HINTS ${SGE_ROOT}/include
16+
)
17+
18+
FIND_LIBRARY(
19+
SGE_CORE_LIBRARY
20+
NAMES sgecore
21+
HINTS ${SGE_ROOT}/lib
22+
)
23+
24+
FIND_LIBRARY(
25+
SGE_GUI_LIBRARY
26+
NAMES sgegui
27+
HINTS ${SGE_ROOT}/lib
28+
)
29+
30+
INCLUDE(FindPackageHandleStandardArgs)
31+
32+
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
33+
SGE
34+
DEFAULT_MSG
35+
SGE_CORE_LIBRARY
36+
SGE_GUI_LIBRARY
37+
SGE_INCLUDE_DIRS
38+
)
39+
40+
MARK_AS_ADVANCED(
41+
SGE_CORE_LIBRARY
42+
SGE_GUI_LIBRARY
43+
SGE_INCLUDE_DIRS
44+
)

0 commit comments

Comments
 (0)