forked from ebertolazzi/G1fitting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
77 lines (65 loc) · 3.37 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
############################################################################
# #
# file: CMakeLists.txt #
# Copyright (C) 2016 #
# Enrico Bertolazzi #
# Dipartimento di Ingegneria Industriale #
# Universita` degli Studi di Trento #
# email: [email protected] #
# #
############################################################################
cmake_minimum_required(VERSION 3.5)
SET( TARGET Clothoid )
PROJECT( ${TARGET} CXX C )
SET( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE )
SET( CMAKE_VERBOSE_MAKEFILE TRUE )
SET( CMAKE_BUILD_TYPE Release )
IF( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC )
SET( CMAKE_CXX_FLAGS "-Wall -Wcast-align" )
IF ( APPLE )
SET( CMAKE_CXX_FLAGS_RELEASE "-O3 -g0 -funroll-loops " )
SET( CMAKE_CXX_FLAGS_DEBUG "-O1 -g -DDEBUG " )
ELSE()
SET( CMAKE_CXX_FLAGS_RELEASE "-fPIC -fno-common -O3 -g0 -funroll-loops " )
SET( CMAKE_CXX_FLAGS_DEBUG "-fPIC -fno-common -O1 -g -DDEBUG " )
ENDIF()
ELSEIF( MSVC )
SET( VSFLAGS_COMMON "/nologo /GS /W3 /WX- /Gm- /Gd /fp:precise /EHsc /FS /D_WINDOWS /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /DHAVE_STRING_H /DNO_GETTIMEOFDAY" )
SET( CMAKE_CXX_FLAGS_RELEASE "/O2 /MD ${VSFLAGS_COMMON}" )
SET( CMAKE_CXX_FLAGS_DEBUG "/Od /Ob0 /MDd /Zi /RTC1 /D_DEBUG ${VSFLAGS_COMMON}" )
ENDIF()
SET( CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS} )
SET( CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE} )
SET( CMAKE_C_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG} )
SET( SOURCES )
FILE( GLOB S ./src/*.cc )
FOREACH (F ${S})
FILE( RELATIVE_PATH RF ${CMAKE_CURRENT_SOURCE_DIR} "${F}" )
LIST( APPEND SOURCES ${RF} )
ENDFOREACH (F ${S})
SET( HEADERS )
FILE( GLOB S ./src/*.hh )
FOREACH (F ${S})
FILE( RELATIVE_PATH RF ${CMAKE_CURRENT_SOURCE_DIR} "${F}" )
LIST( APPEND HEADERS ${RF} )
ENDFOREACH (F ${S})
INCLUDE_DIRECTORIES( src )
add_library( ${TARGET} STATIC ${SOURCES} ${HEADERS} )
ADD_EXECUTABLE( test1 src_tests/test1.cc ${HEADERS} )
TARGET_LINK_LIBRARIES( test1 ${TARGET} )
ADD_EXECUTABLE( test2 src_tests/test2.cc ${HEADERS} )
TARGET_LINK_LIBRARIES( test2 ${TARGET} )
MESSAGE( STATUS "Using ${SSE_FLAGS} extensions")
MESSAGE( STATUS "C compiler = ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER}" )
MESSAGE( STATUS "C++ compiler = ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER}" )
MESSAGE( STATUS "CMAKE_CXX_FLAGS_RELEASE = ${CMAKE_CXX_FLAGS_RELEASE}" )
MESSAGE( STATUS "CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}" )
MESSAGE( STATUS "CMAKE_C_FLAGS_RELEASE = ${CMAKE_C_FLAGS_RELEASE}" )
MESSAGE( STATUS "CMAKE_C_FLAGS = ${CMAKE_C_FLAGS}" )
MESSAGE( STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}" )
MESSAGE( STATUS "CMAKE_SYSTEM_PROCESSOR = ${CMAKE_SYSTEM_PROCESSOR}" )
IF(APPLE)
MESSAGE( STATUS "CMAKE_OSX_SYSROOT = ${CMAKE_OSX_SYSROOT}" )
MESSAGE( STATUS "CMAKE_OSX_ARCHITECTURES = ${CMAKE_OSX_ARCHITECTURES}" )
MESSAGE( STATUS "CMAKE_OSX_DEPLOYMENT_TARGET = ${CMAKE_OSX_DEPLOYMENT_TARGET}" )
ENDIF()