CMAKE_MINIMUM_REQUIRED (VERSION 2.6.2)
PROJECT(yaca)
-SET(VERSION "0.0.1")
+SET(VERSION "0.0.5")
## pkgconfig ###################################################################
INCLUDE(FindPkgConfig)
## Color output if it's possible:
IF (( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND NOT (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9))
- OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" ))
+ OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" ))
- IF (YACA_BUILD_FORCE_COMPILER_COLORS)
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always")
- ENDIF()
+ IF (YACA_BUILD_FORCE_COMPILER_COLORS)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always")
+ ENDIF()
ENDIF()
## Compiler flags, depending on the build type #################################
IF(NOT CMAKE_BUILD_TYPE)
- SET(CMAKE_BUILD_TYPE "DEBUG")
+ SET(CMAKE_BUILD_TYPE "DEBUG")
ENDIF(NOT CMAKE_BUILD_TYPE)
## Print build information #####################################################
MESSAGE(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
MESSAGE(STATUS "-------------------------------------------------")
-SET(CMAKE_C_FLAGS_DEBUG "-std=c99 -O0 -ggdb -Wp,-U_FORTIFY_SOURCE")
-SET(CMAKE_C_FLAGS_RELEASE "-std=c99 -O2 -DNDEBUG")
+SET(CMAKE_C_FLAGS_DEBUG "-std=c11 -O0 -ggdb -Wp,-U_FORTIFY_SOURCE")
+SET(CMAKE_C_FLAGS_RELEASE "-std=c11 -O2 -DNDEBUG")
ADD_DEFINITIONS("-fPIC") # Position Independent Code
ADD_DEFINITIONS("-Werror") # Make all warnings into errors
ADD_DEFINITIONS("-Wall") # Generate all warnings
-#ADD_DEFINITIONS("-Wextra") # Generate even more extra warnings
-#ADD_DEFINITIONS("-pedantic") # Be pedantic
-#ADD_DEFINITIONS("-pedantic-errors") # Make pedantic warnings into errors
+ADD_DEFINITIONS("-Wextra") # Generate even more extra warnings
+ADD_DEFINITIONS("-pedantic") # Be pedantic
+ADD_DEFINITIONS("-pedantic-errors") # Make pedantic warnings into errors
ADD_DEFINITIONS(-DPROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}")
IF("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
- # Warn about documentation problems
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wdocumentation")
- # Enable all diagnostics
- #SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Weverything")
+ # Warn about documentation problems
+ ADD_DEFINITIONS("-Wdocumentation")
+ # Enable all diagnostics
+ #ADD_DEFINITIONS("-Weverything")
ENDIF()
## Subdirectories ##############################################################
-SET(API_FOLDER ${PROJECT_SOURCE_DIR}/api)
+SET(API_FOLDER ${PROJECT_SOURCE_DIR}/api/yaca)
SET(EXAMPLES_FOLDER ${PROJECT_SOURCE_DIR}/examples)
SET(SRC_FOLDER ${PROJECT_SOURCE_DIR}/src)
-SET(TEST_FOLDER ${PROJECT_SOURCE_DIR}/test)
+SET(PYTHON_FOLDER ${PROJECT_SOURCE_DIR}/python)
IF(NOT DEFINED LIB_INSTALL_DIR)
- SET(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
+ SET(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
ENDIF(NOT DEFINED LIB_INSTALL_DIR)
IF(NOT DEFINED INCLUDE_INSTALL_DIR)
- SET(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
+ SET(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
ENDIF(NOT DEFINED INCLUDE_INSTALL_DIR)
IF(NOT DEFINED BIN_INSTALL_DIR)
- SET(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")
+ SET(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")
ENDIF(NOT DEFINED BIN_INSTALL_DIR)
+IF(NOT DEFINED SHARE_INSTALL_PREFIX)
+ SET(SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share")
+ENDIF(NOT DEFINED SHARE_INSTALL_PREFIX)
+
+IF(NOT DEFINED EXAMPLES_DIR)
+ SET(EXAMPLES_DIR "${SHARE_INSTALL_PREFIX}/${PROJECT_NAME}/examples")
+ENDIF(NOT DEFINED EXAMPLES_DIR)
+
+CONFIGURE_FILE(packaging/yaca.manifest.in yaca.manifest @ONLY)
+
ADD_SUBDIRECTORY(${SRC_FOLDER})
-#ADD_SUBDIRECTORY(${TEST_FOLDER})
ADD_SUBDIRECTORY(${EXAMPLES_FOLDER})
+IF(NOT WITHOUT_PYTHON)
+ ADD_SUBDIRECTORY(${PYTHON_FOLDER})
+ENDIF(NOT WITHOUT_PYTHON)