update the build system: only basic build works
This commit is contained in:
parent
b0107e44da
commit
8a81bd2191
32 changed files with 244 additions and 377 deletions
|
|
@ -1,51 +1,5 @@
|
|||
############################################################################
|
||||
##########
|
||||
### 1) If you want to set your own variables in install.cmake and avoid the cmd line
|
||||
######################################################################################
|
||||
|
||||
INCLUDE(install.cmake OPTIONAL)
|
||||
|
||||
######################################################################################
|
||||
|
||||
######################################################################################
|
||||
### 2) Project properties
|
||||
######################################################################################
|
||||
|
||||
# Checks cmake version compatibility
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
|
||||
PROJECT(EDO)
|
||||
|
||||
SET(PROJECT_VERSION_MAJOR 0)
|
||||
SET(PROJECT_VERSION_MINOR 1)
|
||||
SET(PROJECT_VERSION_PATCH 0)
|
||||
SET(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
||||
|
||||
######################################################################################
|
||||
|
||||
|
||||
######################################################################################
|
||||
### 3) Include useful features
|
||||
######################################################################################
|
||||
|
||||
# include useful features for cmake
|
||||
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/cmake/modules)
|
||||
|
||||
|
||||
INCLUDE(FindDoxygen)
|
||||
INCLUDE(FindPkgConfig)
|
||||
|
||||
IF( WITH_BOOST AND WITH_EIGEN )
|
||||
MESSAGE( "ERROR: You have to choose between Boost:ublas and Eigen, you cannot compile with both libraries" )
|
||||
SET(IS_FATAL 1)
|
||||
ELSEIF( NOT WITH_BOOST AND NOT WITH_EIGEN )
|
||||
#MESSAGE( "WARNING: Boost:ublas and Eigen are both deactivated, some features may lack." )
|
||||
# FIXME ideally, we would have a minimal implementation with STL vectors…
|
||||
MESSAGE( "FIXME: Boost:ublas and Eigen are both deactivated, too much features will lack, you should choose one." )
|
||||
SET(IS_FATAL 1)
|
||||
ENDIF()
|
||||
|
||||
IF(WITH_BOOST)
|
||||
IF(EDO_USE_LIB STREQUAL "UBlas")
|
||||
FIND_PACKAGE(Boost 1.33.0)
|
||||
IF( Boost_FOUND )
|
||||
INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} )
|
||||
|
|
@ -54,7 +8,7 @@ IF(WITH_BOOST)
|
|||
MESSAGE( "ERROR: You asked for Boost:ublas but it has nost been found." )
|
||||
SET(IS_FATAL 1)
|
||||
ENDIF()
|
||||
ELSEIF( WITH_EIGEN )
|
||||
ELSEIF( EDO_USE_LIB STREQUAL "Eigen3" )
|
||||
# FIXME FindEigen3.cmake does not work
|
||||
#find_package(Eigen3)
|
||||
#include_directories(EIGEN3_INCLUDE_DIR)
|
||||
|
|
@ -65,100 +19,33 @@ ELSEIF( WITH_EIGEN )
|
|||
INCLUDE_DIRECTORIES( ${EIGEN3_INCLUDE_DIR} )
|
||||
ADD_DEFINITIONS( -DWITH_EIGEN )
|
||||
ELSE()
|
||||
MESSAGE( "ERROR: You asked for Eigen but it has nost been found." )
|
||||
MESSAGE( "ERROR: You asked for Eigen3 but it has nost been found." )
|
||||
SET(IS_FATAL 1)
|
||||
ENDIF()
|
||||
|
||||
ELSE()
|
||||
# FIXME ideally, we would have a minimal implementation with STL vectors…
|
||||
MESSAGE( "You must set EDO_USE_LIB to either 'UBlas' or 'Eigen3'." )
|
||||
SET(IS_FATAL 1)
|
||||
ENDIF()
|
||||
|
||||
FIND_PACKAGE(EO)
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${EO_INCLUDE_DIRS}
|
||||
${MO_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
LINK_DIRECTORIES(
|
||||
${EO_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
######################################################################################
|
||||
|
||||
|
||||
######################################################################################
|
||||
### 4) Include header files path
|
||||
### Include subdirectories
|
||||
######################################################################################
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
add_subdirectory(doc)
|
||||
add_subdirectory(src)
|
||||
|
||||
######################################################################################
|
||||
if(ENABLE_CMAKE_TESTING)
|
||||
add_subdirectory(test)
|
||||
endif(ENABLE_CMAKE_TESTING)
|
||||
|
||||
if(ENABLE_CMAKE_EXAMPLE)
|
||||
if(${CMAKE_VERBOSE_MAKEFILE})
|
||||
message("EDO examples:")
|
||||
endif(${CMAKE_VERBOSE_MAKEFILE})
|
||||
add_subdirectory(tutorial)
|
||||
add_subdirectory(application)
|
||||
endif(ENABLE_CMAKE_EXAMPLE)
|
||||
|
||||
######################################################################################
|
||||
### 5) Set compiler definitions
|
||||
######################################################################################
|
||||
|
||||
IF(UNIX)
|
||||
# enable warnings
|
||||
ADD_DEFINITIONS( -Wall -W -Wextra )
|
||||
# ADD_DEFINITIONS( -Weffc++)
|
||||
# ADD_DEFINITIONS( -g3 )
|
||||
ENDIF()
|
||||
|
||||
######################################################################################
|
||||
|
||||
|
||||
######################################################################################
|
||||
### 6) Prepare some variables for CMAKE usage
|
||||
######################################################################################
|
||||
|
||||
# Empty source files, because we want to build a library
|
||||
SET(SAMPLE_SRCS)
|
||||
|
||||
######################################################################################
|
||||
|
||||
|
||||
######################################################################################
|
||||
### 7) Now where we go ?
|
||||
######################################################################################
|
||||
|
||||
ADD_SUBDIRECTORY(src)
|
||||
ADD_SUBDIRECTORY(application)
|
||||
ADD_SUBDIRECTORY(test)
|
||||
ADD_SUBDIRECTORY(doc)
|
||||
|
||||
######################################################################################
|
||||
|
||||
|
||||
|
||||
######################################################################################
|
||||
### 8) Create executable, link libraries and prepare target
|
||||
######################################################################################
|
||||
|
||||
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
|
||||
|
||||
LINK_DIRECTORIES(${LIBRARY_OUTPUT_PATH})
|
||||
|
||||
ADD_LIBRARY(edo STATIC ${SAMPLE_SRCS})
|
||||
INSTALL(TARGETS edo ARCHIVE DESTINATION lib COMPONENT libraries)
|
||||
|
||||
######################################################################################
|
||||
|
||||
|
||||
######################################################################################
|
||||
### 9) Install pkg-config config file for EO
|
||||
######################################################################################
|
||||
|
||||
INSTALL(FILES edo.pc DESTINATION lib/pkgconfig COMPONENT headers)
|
||||
|
||||
######################################################################################
|
||||
|
||||
|
||||
######################################################################################
|
||||
### 10) Include packaging
|
||||
######################################################################################
|
||||
|
||||
INCLUDE(Packaging.cmake)
|
||||
|
||||
######################################################################################
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue