Skip to content
Snippets Groups Projects
Commit edca0bc7 authored by Riccardo Maria Bianchi's avatar Riccardo Maria Bianchi :sunny:
Browse files

Merge branch 'master' of ssh://gitlab.cern.ch:7999/GeoModelDev/GeoModel into master-ci

parents b627fcf6 0e9d84e3
Branches
Tags
1 merge request!2CI: set Ubuntu and macOS pipelines for the new monorepo
......@@ -7,7 +7,7 @@ project( "GeoModel" VERSION 1.0.0 LANGUAGES CXX )
# === Project wide setup ===
# Make the module directory visible to CMake.
# Make the 'cmake' module directory visible to CMake.
list( APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake )
# Define color codes for CMake messages
include( cmake_colors_defs )
......@@ -21,7 +21,9 @@ include( BuildType )
include( PrintBuildInfo )
# === Externally provided content ===
add_subdirectory(dependencies)
# Make the 'dependencies' module directory visible to CMake.
list( APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/dependencies )
include(Dependencies)
# === Main targets built by this project ===
......
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Set up the project.
# cmake_minimum_required( VERSION 3.1 )
project( "GeoModelTools" VERSION 4.0.0 LANGUAGES CXX )
# Set default build options.
......@@ -9,19 +8,9 @@ set( CMAKE_BUILD_TYPE "Release" CACHE STRING "CMake build mode to use" )
set( CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard used for the build" )
set( CMAKE_CXX_EXTENSIONS FALSE CACHE BOOL "(Dis)allow using GNU extensions" )
# # Make the module directory visible to CMake.
# Make the module directory visible to CMake.
list( APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake )
#
# # Use the GNU install directory names.
# include( GNUInstallDirs )
#
# # Set up the "optional" dependencies.
# include( SetupXercesC )
# include( SetupJSON )
#
# # Find the externals needed by the project.
# find_package( GeoModelCore 3.2.0 REQUIRED )
# find_package( GeoModelIO 3.2.0 REQUIRED )
find_package( XercesC )
# Set up the build of the libraries of the project.
......
......@@ -22,15 +22,7 @@ endif()
# installed with Homebrew on macOS).
# This is not needed if the single-header library is installed in a regular
# system include folder (e.g., '/usr/local/include', '/usr/include', ...)
# Also, note that nlohmann_json has been found (or not) at the root level already,
# but apparently it needs to be "found" here again,
# otherwise the nlohmann_json CMake config file is not found properly.
# Thus, in case SetupJSON.cmake finds it at root level, the variable
# SetupJSON_nlohmann_json_FOUND is set to true, and here we "find" nlohmann_json
# again. (TODO: to be investigated if we can simplify all that: ideally,
# finding it at root level inside SetupJSON.cmake should be enough.)
if ( nlohmann_json_FOUND OR SetupJSON_nlohmann_json_FOUND )
find_package(nlohmann_json QUIET)
if ( nlohmann_json_FOUND )
target_link_libraries( GeoModelJSONParser PUBLIC nlohmann_json::nlohmann_json )
endif()
......
......@@ -66,11 +66,12 @@ endif()
target_link_libraries (GXClashPointSystems PRIVATE SoQt::SoQt Coin::Coin ${Qt5Core_LIBRARIES} GXGui GXBase GXHEPVis ${SoQt_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5PrintSupport_LIBRARIES} )
# we link to nlohmann_json only if we use a version of nlohmann_json installed through CMake;
# this is not needed if the single-header library is installed in a regular
# system include folder (e.g., '/usr/local/include')
if( nlohmann_json_FOUND )
# We link to `nlohmann_json` only if we use a version of nlohmann_json
# that provides a CMake config file (i.e., either built from source, or also
# installed with Homebrew on macOS).
# This is not needed if the single-header library is installed in a regular
# system include folder (e.g., '/usr/local/include', '/usr/include', ...)
if ( nlohmann_json_FOUND )
target_link_libraries( GXClashPointSystems PUBLIC nlohmann_json::nlohmann_json )
endif()
......
......@@ -62,10 +62,12 @@ include_directories(${SoQt_INCLUDE_DIRS} )
include_directories(${VP1HEPVis_INCLUDE_DIRS} )
# we link to nlohmann_json only if we use a version of nlohmann_json installed through CMake;
# this is not needed if the single-header library is installed in a regular
# system include folder (e.g., '/usr/local/include')
if( nlohmann_json_FOUND )
# We link to `nlohmann_json` only if we use a version of nlohmann_json
# that provides a CMake config file (i.e., either built from source, or also
# installed with Homebrew on macOS).
# This is not needed if the single-header library is installed in a regular
# system include folder (e.g., '/usr/local/include', '/usr/include', ...)
if ( nlohmann_json_FOUND )
target_link_libraries( GXGeometrySystems nlohmann_json::nlohmann_json )
endif()
......@@ -79,8 +81,8 @@ endif()
# Set a variable storing the CMake install prefix.
# -- It is passed to the C++ preprocessor to load, from the C++ code,
# -- the JSON files storing the default materials and volume attributes
# -- for Coin3D.
# the JSON files storing the default materials and volume attributes
# for Coin3D.
add_definitions ( -DGEOMODEL_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX})
......
File moved
......@@ -59,7 +59,7 @@ else()
message(STATUS "SetupJSON - WARNING! 'nlohmann_json' was not found by CMake!! However, if you installed this single-header library in a standard system include dir (e.g., '/usr/local/include'), I will be able to use it.")
else()
message(STATUS "SetupJSON - Found 'nlohmann_json' at: ${nlohmann_json_DIR}")
set( SetupJSON_nlohmann_json_FOUND TRUE CACHE BOOL "True if nlohmann_json has been found by the SetupJSON module" FORCE )
# set( SetupJSON_nlohmann_json_FOUND TRUE CACHE BOOL "True if nlohmann_json has been found by the SetupJSON module" FORCE )
endif()
endif()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment