Commit 45f3d35f authored by Arnaud Le Meillour's avatar Arnaud Le Meillour
Browse files

New project structure

parent cf24d5c7
......@@ -4,23 +4,68 @@ variables:
stages:
- build
#- trig
- test
- deploy
# COMMON ################################################
.build: &build
.common-build:
stage: build
only:
- develop
- branches
- merge_requests
- tags
script:
- id
- mkdir build && cd build
- cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ..
- make -j
#- tree -Ca -I ".*" ..
- test -d /opt/os_dev
- chmod -R a+rw .
- sudo -u dserver /usr/bin/make install
artifacts:
paths:
- build
expire_in: 1 day
.common-test:
stage: test
only:
- branches
- merge_requests
script:
- cd build
- mkdir $CI_PROJECT_DIR/test
- cmake DESTDIR=$CI_PROJECT_DIR/test install
- tree -Ca $CI_PROJECT_DIR/test
.common-deploy:
stage: deploy
only:
- tags
script:
- cd ${LIB_NAME}/build
- '[[ -d ${BUILD_DIR}/lib/classes ]]'
- cmake install
include:
- project: 'accelerators/cicd/templates_cicd/template-rev1'
ref: main
file: '/build_lib.yml'
# JOB DEBIAN 9 ################################################
......
set(HOME_PREFIX ESRF)
# Generic main project
project(Root)
cmake_minimum_required (VERSION 3.15)
###############################################################################
# List of TANGO device servers to build (from defined classes below)
set(PROJECT_BIN_SERVERS
# List of TANGO device servers to build (from defined classes/lib below)
set(PROJECT_BIN
Serial
)
# External shared libraries of TANGO classes needed on this project
set(PROJECT_LIB_CLASSES_EXTERNAL
# External shared libraries needed on this project
set(PROJECT_LIB_EXTERNAL
)
# Local shared libraries of TANGO classes needed on this project
set(PROJECT_LIB_CLASSES_INTERNAL
# Local shared libraries needed on this project
set(PROJECT_LIB_INTERNAL
Serial
)
# Global dependencies (C++, Tango...)
set(GLOBAL_LIB_EXTERNAL tango;COS4;omniORB4;omniDynamic4;omnithread;zmq)
set(GLOBAL_LIB_SYSTEM dl;pthread)
# Default repository
set(DEV_REPOSITORY "/opt/os_dev")
#######################################
# CMake configuration
cmake_minimum_required (VERSION 3.15)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_VERBOSE_MAKEFILE OFF)
set(CMAKE_COLOR_MAKEFILE ON)
set(CMAKE_SKIP_RPATH true)
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "${HOME_PREFIX}::In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there." )
endif()
#######################################
# Generic main project
project(Root)
#######################################
# Set the build type as Release (with debug info) if no Debug mode is requested
message("BUILD CONFIG ##############################")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(BUILD_TYPE "debug")
else()
set(CMAKE_BUILD_TYPE RelWithDebInfo)
set(BUILD_TYPE "release")
endif()
#######################################
# Check if execute from GitLab
if(DEFINED ENV{CI_COMMIT_SHA})
set(BATCH YES)
message(STATUS "${HOME_PREFIX}::Build ${CMAKE_BUILD_TYPE} (GitLab)")
else()
set(BATCH NO)
message(STATUS "${HOME_PREFIX}::Build ${CMAKE_BUILD_TYPE} (interactive)")
endif()
#######################################
# load lib
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
include(./cmake/lib.cmake)
######################################
# Set local CMAKE_INSTALL_PREFIX to our ref repository if specific install DIR done
# Add build type [Release, Debug] subdirectory to the install DIR
set(CMAKE_INSTALL_PREFIX_previous ${CMAKE_INSTALL_PREFIX})
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(INSTALL_PREFIX "${DEV_REPOSITORY}")
else()
set(INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
endif()
unset(CMAKE_INSTALL_PREFIX CACHE)
set(CMAKE_INSTALL_PREFIX "${INSTALL_PREFIX}/${BUILD_TYPE}")
message(STATUS "${HOME_PREFIX}::Change CMAKE_INSTALL_PREFIX (${CMAKE_INSTALL_PREFIX_previous}) to ${CMAKE_INSTALL_PREFIX}")
#######################################
# Debud info
#include(${CMAKE_SOURCE_DIR}/cmake/env.cmake)
#######################################
# Load global resources
message("GLOBAL LIB RESOURCES ##############################")
foreach(LIB IN ITEMS ${GLOBAL_LIB_EXTERNAL})
#set(CMAKE_FIND_DEBUG_MODE TRUE)
find_package(${LIB} REQUIRED
PATHS
${DEV_REPOSITORY}/${BUILD_TYPE}/lib/cmake
)
#set(CMAKE_FIND_DEBUG_MODE FALSE)
message(STATUS "${HOME_PREFIX}::Registering the global ${LIB} library ...")
message(STATUS "${HOME_PREFIX}:: - ${LIB}_LIB = ${${LIB}_LIB}")
message(STATUS "${HOME_PREFIX}:: - ${LIB}_LIB_DIR = ${${LIB}_LIB_DIR}")
message(STATUS "${HOME_PREFIX}:: - ${LIB}_INCLUDE_DIR = ${${LIB}_INCLUDE_DIR}")
list(APPEND GLOBAL_LIB ${${LIB}_LIB})
list(APPEND GLOBAL_LIB_DIR ${${LIB}_LIB_DIR})
list(APPEND GLOBAL_INCLUDE_DIR ${${LIB}_INCLUDE_DIR})
endforeach()
# Default global dependencies
set(DEFAULT_LIB_TANGO tango;COS4;omniORB4;omniDynamic4;omnithread;zmq)
set(DEFAULT_LIB_SYSTEM dl;pthread)
###############################################################################
list(APPEND GLOBAL_LIB ${GLOBAL_LIB_SYSTEM})
message(STATUS "${HOME_PREFIX}::GLOBAL libraries: ${GLOBAL_LIB}")
# Load base cmake macro
include(./cmake/macro/default-macro.cmake)
# Load user cmake macro
include(./cmake/macro/user-macro.cmake)
#######################################
# Project TANGO classes
message("TANGO CLASSES RESOURCES ##############################")
# Load base cmake configuration
include(./cmake/config/default-config.cmake)
# Load user cmake configuration
include(./cmake/config/user-config.cmake)
if(PROJECT_LIB_CLASSES_EXTERNAL)
message("## Management of TANGO classes (shared libraries external to this project)...")
set(PROJECT_LIB_CLASSES_EXTERNAL_clone ${PROJECT_LIB_CLASSES_EXTERNAL})
while(PROJECT_LIB_CLASSES_EXTERNAL_clone)
list(POP_FRONT PROJECT_LIB_CLASSES_EXTERNAL_clone CLASS_NAME CLASS_VERSION)
#set(CMAKE_FIND_DEBUG_MODE TRUE)
find_package(${CLASS_NAME} ${CLASS_VERSION} REQUIRED
PATHS
${DEV_REPOSITORY}/${BUILD_TYPE}/lib/classes
${CMAKE_INSTALL_PREFIX}/lib/classes
)
#set(CMAKE_FIND_DEBUG_MODE FALSE)
message(STATUS "${HOME_PREFIX}::Registering the shared ${CLASS_NAME} library in version ${CLASS_VERSION}")
message(STATUS "${HOME_PREFIX}:: - ${CLASS_NAME}_LIB = ${${CLASS_NAME}_LIB}")
message(STATUS "${HOME_PREFIX}:: - ${CLASS_NAME}_LIB_DIR = ${${CLASS_NAME}_LIB_DIR}")
message(STATUS "${HOME_PREFIX}:: - ${CLASS_NAME}_INCLUDE_DIR = ${${CLASS_NAME}_INCLUDE_DIR}")
endwhile()
endif()
# Load external libraries
include(./cmake/find-lib.cmake)
if(PROJECT_LIB_CLASSES_INTERNAL)
message("## Management of TANGO classes (shared libraries internal to this project)...")
# Build internal libraries
if(PROJECT_LIB_INTERNAL)
message("# BUILD INTERNAL LIB")
unset(CLASS CACHE)
foreach(CLASS IN ITEMS ${PROJECT_LIB_CLASSES_INTERNAL})
foreach(CLASS IN ITEMS ${PROJECT_LIB_INTERNAL})
add_subdirectory(./classes/${CLASS})
endforeach()
endif()
#######################################
# Project TANGO device servers
message("TANGO DEVICE SERVERS ##############################")
if(PROJECT_BIN_SERVERS)
message("## Management of TANGO device servers ...")
# Build TANGO device servers
if(PROJECT_BIN)
message("# BUILD TANGO DEVICE SERVERS")
unset(DEVICE_SERVER CACHE)
foreach(DEVICE_SERVER IN ITEMS ${PROJECT_BIN_SERVERS})
foreach(DEVICE_SERVER IN ITEMS ${PROJECT_BIN})
add_subdirectory(servers/${DEVICE_SERVER})
endforeach()
endif()
\ No newline at end of file
......@@ -8,13 +8,14 @@ project(Serial
CXX
)
set(PROJECT_DEPENDENCIES )
###############################################################################
message(STATUS "${HOME_PREFIX}::Build preparation for TANGO class ${PROJECT_NAME} in version ${PROJECT_VERSION}")
message(STATUS "${USER_PREFIX}::Build TANGO class ${PROJECT_NAME} in version ${PROJECT_VERSION}")
# If your build need more specific directives, replace include file by it's containt and custom your build.
#######################################
# Add project source files
unset(SOURCE_FILES)
#AUX_SOURCE_DIRECTORY(./src SOURCE_FILES)
set(SOURCE_FILES
src/${PROJECT_NAME}.cpp
src/${PROJECT_NAME}Class.cpp
......@@ -26,11 +27,9 @@ elseif(UNIX)
List(APPEND SOURCE_FILES src/SerialLinux.cpp)
endif()
#######################################
# Mgmt project tango class dependencies
include(${CMAKE_SOURCE_DIR}/cmake/add-dependencies.cmake)
#######################################
# Build Shared Lib
include(${CMAKE_SOURCE_DIR}/cmake/build-shared.cmake)
# Build library
include(${CMAKE_SOURCE_DIR}/cmake/build-lib.cmake)
if(PROJECT_DEPENDENCIES)
unset(_CLASS CACHE)
foreach(_CLASS IN ITEMS ${PROJECT_DEPENDENCIES})
if(${_CLASS} IN_LIST PROJECT_LIB_CLASSES_EXTERNAL)
list(APPEND CLASSES_EXT ${${_CLASS}_LIB})
list(APPEND CLASSES_EXT_LIB_DIR ${${_CLASS}_LIB_DIR})
list(APPEND CLASSES_EXT_INCLUDE_DIR ${${_CLASS}_INCLUDE_DIR})
elseif(${_CLASS} IN_LIST PROJECT_LIB_CLASSES_INTERNAL)
list(APPEND CLASSES_INT ${_CLASS})
list(APPEND CLASSES_INT_TARGET ${_CLASS}_shared)
list(APPEND CLASSES_INT_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/classes/${_CLASS}/include)
unset(_LIB CACHE)
foreach(_LIB IN ITEMS ${PROJECT_DEPENDENCIES})
if(${_LIB} IN_LIST PROJECT_LIB_EXTERNAL)
list(APPEND TARGET_EXT_LIB ${${_LIB}_LIB})
list(APPEND TARGET_EXT_LIB_DIR ${${_LIB}_LIB_DIR})
list(APPEND TARGET_EXT_LIB_INCLUDE_DIR ${${_LIB}_INCLUDE_DIR})
elseif(${_LIB} IN_LIST PROJECT_LIB_INTERNAL)
list(APPEND TARGET_INT_LIB ${_LIB})
list(APPEND TARGET_INT_LIB_TARGET ${_LIB}_target)
list(APPEND TARGET_INT_LIB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/classes/${_LIB}/include)
else()
message(FATAL_ERROR "${HOME_PREFIX}:: - fail to load class (not found): ${_CLASS}")
message(FATAL_ERROR "${USER_PREFIX}:: - fail to load class (not found): ${_LIB}")
endif()
endforeach()
if(CLASSES_EXT)
message(STATUS "${HOME_PREFIX}:: - add external class (shared lib): ${CLASSES_EXT}")
if(TARGET_EXT_LIB)
message(STATUS "${USER_PREFIX}:: - add external class (shared lib): ${TARGET_EXT_LIB}")
endif()
if(CLASSES_INT_TARGET)
message(STATUS "${HOME_PREFIX}:: - add local class (shared lib): ${CLASSES_INT_TARGET}")
if(TARGET_INT_LIB_TARGET)
message(STATUS "${USER_PREFIX}:: - add local class (shared lib): ${TARGET_INT_LIB_TARGET}")
endif()
endif()
\ No newline at end of file
unset(SOURCE_FILES)
AUX_SOURCE_DIRECTORY(./src SOURCE_FILES)
\ No newline at end of file
set(BINARY_TARGET ${PROJECT_NAME}_binary)
add_executable(${BINARY_TARGET})
message(STATUS "${HOME_PREFIX}:: - building binary ${PROJECT_NAME} via target ${BINARY_TARGET}")
include(${CMAKE_SOURCE_DIR}/cmake/conf-build.cmake)
message(STATUS "${USER_PREFIX}:: - building binary ${PROJECT_NAME} via target ${BINARY_TARGET}")
target_sources(${BINARY_TARGET}
PRIVATE
......@@ -12,21 +10,21 @@ target_sources(${BINARY_TARGET}
target_link_libraries(${BINARY_TARGET}
PRIVATE
${GLOBAL_LIB}
${CLASSES_EXT}
${CLASSES_INT_TARGET}
${TARGET_EXT_LIB}
${TARGET_INT_LIB_TARGET}
)
target_link_directories(${BINARY_TARGET}
PRIVATE
${GLOBAL_LIB_DIR}
${CLASSES_EXT_LIB_DIR}
${TARGET_EXT_LIB_DIR}
)
target_include_directories(${BINARY_TARGET}
PRIVATE
${GLOBAL_INCLUDE_DIR}
${CLASSES_EXT_INCLUDE_DIR}
${CLASSES_INT_INCLUDE_DIR}
${TARGET_EXT_LIB_INCLUDE_DIR}
${TARGET_INT_LIB_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/src
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
......@@ -39,7 +37,7 @@ target_compile_options(${BINARY_TARGET}
target_compile_features(${BINARY_TARGET}
PRIVATE
cxx_std_11
${COMPILE_FEATURES}
)
set_target_properties(${BINARY_TARGET}
......@@ -50,6 +48,6 @@ set_target_properties(${BINARY_TARGET}
)
install(TARGETS ${BINARY_TARGET} EXPORT ${BINARY_TARGET}_export
DESTINATION "${INSTALL_BINDIR}"
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/${PROJECT_NAME}
PERMISSIONS ${DEFAULT_PERMISSIONS_BIN}
)
\ No newline at end of file
set(SHARED_TARGET ${PROJECT_NAME}_shared)
add_library(${SHARED_TARGET} SHARED)
message(STATUS "${HOME_PREFIX}:: - building shared library ${PROJECT_NAME} via target ${SHARED_TARGET}")
set(LIB_TARGET ${PROJECT_NAME}_target)
include(${CMAKE_SOURCE_DIR}/cmake/conf-build.cmake)
add_library(${LIB_TARGET})
message(STATUS "${USER_PREFIX}:: - building library ${PROJECT_NAME} via target ${LIB_TARGET}")
unset(PUBLIC_HEADER)
GET_HEADER_FILES(_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include)
......@@ -10,48 +9,48 @@ foreach(_HEADER IN ITEMS ${_HEADERS})
list(APPEND PUBLIC_HEADER include/${_HEADER})
endforeach()
target_sources(${SHARED_TARGET}
target_sources(${LIB_TARGET}
PRIVATE
${SOURCE_FILES}
)
target_link_libraries(${SHARED_TARGET}
target_link_libraries(${LIB_TARGET}
PRIVATE
${GLOBAL_LIB}
PUBLIC
${CLASSES_EXT}
${CLASSES_INT_TARGET}
${TARGET_EXT_LIB}
${TARGET_INT_LIB_TARGET}
)
target_link_directories(${SHARED_TARGET}
target_link_directories(${LIB_TARGET}
PRIVATE
${GLOBAL_LIB_DIR}
PUBLIC
${CLASSES_EXT_LIB_DIR}
${TARGET_EXT_LIB_DIR}
)
target_include_directories(${SHARED_TARGET}
target_include_directories(${LIB_TARGET}
PRIVATE
${GLOBAL_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/src
${CLASSES_INT_INCLUDE_DIR}
${TARGET_INT_LIB_INCLUDE_DIR}
PUBLIC
${CLASSES_EXT_INCLUDE_DIR}
${TARGET_EXT_LIB_INCLUDE_DIR}
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>${INSTALL_INCLUDEDIR}>
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}-${PROJECT_VERSION}/include>
)
target_compile_options(${SHARED_TARGET}
target_compile_options(${LIB_TARGET}
PRIVATE
${COMPILE_OPTIONS}
)
target_compile_features(${SHARED_TARGET}
target_compile_features(${LIB_TARGET}
PRIVATE
cxx_std_11
${COMPILE_FEATURES}
)
set_target_properties(${SHARED_TARGET}
set_target_properties(${LIB_TARGET}
PROPERTIES
OUTPUT_NAME ${PROJECT_NAME}
OUTPUT_NAME_RELEASE ${PROJECT_NAME}
......@@ -61,32 +60,24 @@ set_target_properties(${SHARED_TARGET}
VERSION ${PROJECT_VERSION}
)
install(TARGETS ${SHARED_TARGET} EXPORT ${SHARED_TARGET}_export
LIBRARY DESTINATION "${INSTALL_LIBDIR}"
PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDEDIR}"
INCLUDES DESTINATION "${INSTALL_INCLUDEDIR}"
install(TARGETS ${LIB_TARGET} EXPORT ${LIB_TARGET}_export
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}-${PROJECT_VERSION}/lib
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}-${PROJECT_VERSION}/lib
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}-${PROJECT_VERSION}/include
INCLUDES DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}-${PROJECT_VERSION}/include
PERMISSIONS ${DEFAULT_PERMISSIONS_LIB}
)
configure_package_config_file(
${CMAKE_SOURCE_DIR}/cmake/Config.cmake.in
${CMAKE_SOURCE_DIR}/cmake/template/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION ${INSTALL_CMAKEDIR}
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}-${PROJECT_VERSION}/cmake
)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
COMPATIBILITY AnyNewerVersion
)
if(BATCH)
install(TARGETS ${SHARED_TARGET}
LIBRARY DESTINATION "${INSTALL_LIBDIR_COMMON}"
PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDEDIR}"
INCLUDES DESTINATION "${INSTALL_INCLUDEDIR}"
PERMISSIONS ${DEFAULT_PERMISSIONS_LIB}
)
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
unset(SOURCES)
GET_HEADER_FILES(_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src)
......@@ -102,7 +93,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
FILES
${SOURCES}
DESTINATION
${INSTALL_SOURCESDIR}
${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}-${PROJECT_VERSION}/src
PERMISSIONS
${DEFAULT_PERMISSIONS_LIB}
)
......@@ -113,14 +104,14 @@ install(
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
DESTINATION
${INSTALL_CMAKEDIR}
${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}-${PROJECT_VERSION}/cmake
PERMISSIONS
${DEFAULT_PERMISSIONS_LIB}
)
install(EXPORT ${SHARED_TARGET}_export
install(EXPORT ${LIB_TARGET}_export
FILE ${PROJECT_NAME}Targets.cmake
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${INSTALL_CMAKEDIR}
DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}-${PROJECT_VERSION}/cmake
PERMISSIONS ${DEFAULT_PERMISSIONS_LIB}
)
\ No newline at end of file
#######################################
# Compilation warning if interactive
unset(COMPILE_OPTIONS)
if(BATCH STREQUAL YES)
set(COMPILE_OPTIONS
-W # Inhibit all warning messages.
)
else()
set(COMPILE_OPTIONS
#-Werror # Make all warnings into errors.
-Wall # This enables all the warnings.
-Wextra # This enables some extra warning flags.
-Wpedantic # Issue all the warnings demanded by strict ISO C and ISO C++
-Wnon-virtual-dtor # warns whenever a class with virtual function does not declare a virtual destructor.
-Wshadow # Warn whenever a local variable or type declaration shadows another variable
)
endif()
#######################################
# Set installation DESTINATION
set(FULL_MINOR_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR})
set(INSTALL_BINDIR ${CMAKE_INSTALL_BINDIR}/${PROJECT_NAME})
set(INSTALL_LIBDIR_COMMON ${CMAKE_INSTALL_LIBDIR}/classes/common)
set(INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR}/classes/${PROJECT_NAME}-${FULL_MINOR_VERSION}/lib)
set(INSTALL_INCLUDEDIR ${CMAKE_INSTALL_LIBDIR}/classes/${PROJECT_NAME}-${FULL_MINOR_VERSION}/include)
set(INSTALL_SOURCESDIR ${CMAKE_INSTALL_LIBDIR}/classes/${PROJECT_NAME}-${FULL_MINOR_VERSION}/src)
set(INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/classes/${PROJECT_NAME}-${FULL_MINOR_VERSION}/cmake)
#######################################
# Set installation files PERMISSIONS
set(DEFAULT_PERMISSIONS_CONF
OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
WORLD_READ
)
set(DEFAULT_PERMISSIONS_LIB
OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
WORLD_READ
)
set(DEFAULT_PERMISSIONS_BIN
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)
\ No newline at end of file
message("# LOAD DEFAULT CONFIGURATION - default-config.cmake")
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there." )
endif()
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_VERBOSE_MAKEFILE OFF)
set(CMAKE_COLOR_MAKEFILE ON)
set(CMAKE_SKIP_RPATH true)
set(USER_PREFIX "LOG")
#include(FindPkgConfig)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
# Compilation features & options
set(COMPILE_FEATURES cxx_std_11)
set(COMPILE_OPTIONS
#-Werror # Make all warnings into errors.
-Wall # This enables all the warnings.
-Wextra # This enables some extra warning flags.
-Wpedantic # Issue all the warnings demanded by strict ISO C and ISO C++
-Wnon-virtual-dtor # warns whenever a class with virtual function does not declare a virtual destructor.
-Wshadow # Warn whenever a local variable or type declaration shadows another variable
)
message("# LOAD USER CONFIGURATION - user-config.cmake")
set(USER_PREFIX "ESRF")
set(USER_REPOSITORY "/opt/os_dev")
OPTION(BUILD_SHARED_LIBS "Make Tango classes as Shared libraries" YES)
# Set the build type as Release (with debug info) if no Debug mode is requested
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(BUILD_TYPE_DIR "debug")
else()
set(CMAKE_BUILD_TYPE RelWithDebInfo)