This repository has been archived on 2026-03-28. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
eodev/edo/CMakeLists.txt

132 lines
4.3 KiB
CMake

############################################################################
##########
### 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 1)
SET(PROJECT_VERSION_MINOR 0)
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 ${CMAKE_SOURCE_DIR}/cmake/modules)
INCLUDE(FindDoxygen)
INCLUDE(FindPkgConfig)
FIND_PACKAGE(Boost 1.33.0)
FIND_PACKAGE(EO)
INCLUDE_DIRECTORIES(
${EO_INCLUDE_DIRS}
${MO_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
# /Dev/ometah-0.3/common
)
LINK_DIRECTORIES(
${EO_LIBRARY_DIRS}
)
######################################################################################
######################################################################################
### 4) Include header files path
######################################################################################
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}/src
)
######################################################################################
######################################################################################
### 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)
######################################################################################