CMakeLists.txt 1.89 KB
Newer Older
1
2
3
4
5
6
7
# #require a certain version
CMAKE_MINIMUM_REQUIRED( VERSION 2.6 )

# declare the project name
PROJECT(GBL)

# project version
Christoph Rosemann's avatar
Christoph Rosemann committed
8
SET( ${PROJECT_NAME}_VERSION_MAJOR 1 )
Frank Gaede's avatar
Frank Gaede committed
9
10
SET( ${PROJECT_NAME}_VERSION_MINOR 17 )
SET( ${PROJECT_NAME}_VERSION_PATCH 1 )
11
12
13
14

# make life easier and simply use the ilcsoft default settings
# load default ilcsoft settings (install prefix, build type, rpath, etc.)
LIST( APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake )
Christoph Rosemann's avatar
Christoph Rosemann committed
15
INCLUDE( ilcsoft_default_settings )
16
17
18
19

FIND_PACKAGE(ROOT REQUIRED)

# require proper c++
Frank Gaede's avatar
Frank Gaede committed
20
#ADD_DEFINITIONS( "-Wall -g -ansi -pedantic -Wno-long-long" )
21
22
23
24
25
26
27
28
29
30

# include directories
INCLUDE_DIRECTORIES( BEFORE ./include ${ROOT_INCLUDE_DIRS})
INSTALL( DIRECTORY ./include DESTINATION . PATTERN ".svn" EXCLUDE )

# declare the stupid ROOT library path
LINK_DIRECTORIES(${ROOT_LIBRARY_DIR})

# add library
AUX_SOURCE_DIRECTORY( ./src library_sources )
Christoph Rosemann's avatar
Christoph Rosemann committed
31
ADD_SHARED_LIBRARY( ${PROJECT_NAME} ${library_sources} )
32
33
34
35
36
37
38
39
40
41
42
43
INSTALL( TARGETS ${PROJECT_NAME} DESTINATION lib )

TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${ROOT_LIBS})

# the examples, build with "make examples"
ADD_SUBDIRECTORY( examples/ )
  
# add a target to generate API documentation with Doxygen
FIND_PACKAGE(Doxygen)

if(DOXYGEN_FOUND)

44
45
    INCLUDE(GlobalSVNRevision)
    
46
    CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile @ONLY)
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

    ADD_CUSTOM_TARGET(doc
        ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc
        COMMENT "Generating API documentation with Doxygen" VERBATIM
    )

ELSE()
    MESSAGE( STATUS "Doxygen not installed or found -- API documentation can't be generatred!" )

ENDIF(DOXYGEN_FOUND)

# display some variables and write them to cache
DISPLAY_STD_VARIABLES()

# generate and install following configuration files
GENERATE_PACKAGE_CONFIGURATION_FILES( GBLConfig.cmake GBLConfigVersion.cmake )