Skip to content

Commit 4fe92e0

Browse files
author
Charles PIGNEROL
committed
Version 1.3.0. Creation du projet hors GUIToolkits.
1 parent 10f92a4 commit 4fe92e0

13 files changed

+736
-0
lines changed

CMakeLists.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
cmake_minimum_required(VERSION 3.14)
2+
3+
project (GUIToolkitsVariables LANGUAGES CXX)
4+
5+
set (CURRENT_PACKAGE_NAME "GUIToolkitsVariables")
6+
set (CURRENT_PACKAGE_MACRO_NAME "GUI_TOOLKITS_VARIABLES")
7+
8+
include (GNUInstallDirs)
9+
10+
include (${CMAKE_SOURCE_DIR}/cmake/version.cmake)
11+
include (${CMAKE_SOURCE_DIR}/cmake/organization.cmake)
12+
13+
include(CMakePackageConfigHelpers)
14+
15+
16+
# Installation des fichiers cmake partagés par les composantes installées de GUIToolkits :
17+
set (ConfigPackageLocation ${CMAKE_CMAKE_DIR})
18+
file (GLOB CMAKE_GUI_TOOLKITS_SHARED_FILES "${CMAKE_SOURCE_DIR}/cmake/*.cmake" "${CMAKE_SOURCE_DIR}/cmake/*.py")
19+
install (FILES ${CMAKE_GUI_TOOLKITS_SHARED_FILES} DESTINATION ${ConfigPackageLocation} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ)
20+
21+
# Utilisation par d'autres composantes :
22+
set (PACKAGE_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${ConfigPackageLocation}/") # GUIToolkitsVariables_CMAKE_DIR avec GUIToolkitsVariablesConfig.cmake.in
23+
write_basic_package_version_file(${CMAKE_PACKAGE_VERSION_FILE} VERSION ${GUI_TOOLKITS_VARIABLES_VERSION} COMPATIBILITY SameMajorVersion)
24+
25+
# Création du fichier GUIToolkitsVariablesConfig.cmake qui définira GUIToolkitsVariables_CMAKE_DIR :
26+
configure_package_config_file (cmake/${CMAKE_PACKAGE_CONFIG_NAME}.cmake.in ${CMAKE_PACKAGE_CONFIG_FILE} INSTALL_DESTINATION ${CMAKE_CMAKE_DIR} PATH_VARS PACKAGE_CMAKE_INSTALL_DIR)
27+
28+
# Copie du fichier GUIToolkitsVariablesConfig.cmake dans prefix/lib/GUIToolkitsVariables/cmake :
29+
install (FILES ${CMAKE_PACKAGE_CONFIG_FILE} ${CMAKE_PACKAGE_VERSION_FILE} DESTINATION ${ConfigPackageLocation} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ)
30+

cmake/FindQwt.cmake

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
#
2+
# Surcouche CEA/DAM : ajout des targets (en fin de fichier)
3+
#
4+
5+
#
6+
# (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
7+
#
8+
# This file is part of Orfeo Toolbox
9+
#
10+
# https://www.orfeo-toolbox.org/
11+
#
12+
# Licensed under the Apache License, Version 2.0 (the "License");
13+
# you may not use this file except in compliance with the License.
14+
# You may obtain a copy of the License at
15+
#
16+
# http://www.apache.org/licenses/LICENSE-2.0
17+
#
18+
# Unless required by applicable law or agreed to in writing, software
19+
# distributed under the License is distributed on an "AS IS" BASIS,
20+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
# See the License for the specific language governing permissions and
22+
# limitations under the License.
23+
#
24+
25+
# Qt Widgets for Technical Applications
26+
# available at http://www.http://qwt.sourceforge.net/
27+
#
28+
# The module defines the following variables:
29+
# QWT_FOUND - the system has Qwt
30+
# QWT_INCLUDE_DIR - where to find qwt_plot.h
31+
# QWT_INCLUDE_DIRS - qwt includes
32+
# QWT_LIBRARY - where to find the Qwt library
33+
# QWT_LIBRARIES - additional libraries
34+
# QWT_MAJOR_VERSION - major version
35+
# QWT_MINOR_VERSION - minor version
36+
# QWT_PATCH_VERSION - patch version
37+
# QWT_VERSION_STRING - version (ex. 5.2.1)
38+
# QWT_ROOT_DIR - root dir
39+
40+
#=============================================================================
41+
# Copyright 2010-2013, Julien Schueller
42+
# All rights reserved.
43+
#
44+
# Redistribution and use in source and binary forms, with or without
45+
# modification, are permitted provided that the following conditions are met:
46+
#
47+
# 1. Redistributions of source code must retain the above copyright notice, this
48+
# list of conditions and the following disclaimer.
49+
# 2. Redistributions in binary form must reproduce the above copyright notice,
50+
# this list of conditions and the following disclaimer in the documentation
51+
# and/or other materials provided with the distribution.
52+
#
53+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
54+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
55+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
56+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
57+
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
58+
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
59+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
60+
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
61+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
62+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
63+
64+
# The views and conclusions contained in the software and documentation are those
65+
# of the authors and should not be interpreted as representing official policies,
66+
# either expressed or implied, of the FreeBSD Project.
67+
#=============================================================================
68+
69+
# message( "QWT_INCLUDE_DIR: '${QWT_INCLUDE_DIR}'" )
70+
# message( "QWT_INCLUDE_DIR: '${QT_INCLUDE_DIR}'" )
71+
72+
find_path( QWT_INCLUDE_DIR
73+
NAMES qwt_plot.h
74+
PATH_SUFFIXES qwt
75+
)
76+
77+
# message( "QWT_INCLUDE_DIR: '${QWT_INCLUDE_DIR}'" )
78+
# message( "QWT_INCLUDE_DIR: '${QT_INCLUDE_DIR}'" )
79+
80+
set ( QWT_INCLUDE_DIRS ${QWT_INCLUDE_DIR} )
81+
82+
# version
83+
set ( _VERSION_FILE ${QWT_INCLUDE_DIR}/qwt_global.h )
84+
if ( EXISTS ${_VERSION_FILE} )
85+
file ( STRINGS ${_VERSION_FILE} _VERSION_LINE REGEX "define[ ]+QWT_VERSION_STR" )
86+
if ( _VERSION_LINE )
87+
string ( REGEX REPLACE ".*define[ ]+QWT_VERSION_STR[ ]+\"(.*)\".*" "\\1" QWT_VERSION_STRING "${_VERSION_LINE}" )
88+
string ( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1" QWT_MAJOR_VERSION "${QWT_VERSION_STRING}" )
89+
string ( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\2" QWT_MINOR_VERSION "${QWT_VERSION_STRING}" )
90+
string ( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\3" QWT_PATCH_VERSION "${QWT_VERSION_STRING}" )
91+
endif ()
92+
endif ()
93+
94+
95+
# check version
96+
set ( _QWT_VERSION_MATCH TRUE )
97+
if ( Qwt_FIND_VERSION AND QWT_VERSION_STRING )
98+
if ( Qwt_FIND_VERSION_EXACT )
99+
if ( NOT Qwt_FIND_VERSION VERSION_EQUAL QWT_VERSION_STRING )
100+
set ( _QWT_VERSION_MATCH FALSE )
101+
endif ()
102+
else ()
103+
if ( QWT_VERSION_STRING VERSION_LESS Qwt_FIND_VERSION )
104+
set ( _QWT_VERSION_MATCH FALSE )
105+
endif ()
106+
endif ()
107+
endif ()
108+
109+
110+
find_library ( QWT_LIBRARY
111+
NAMES qwt qwt${QWT_MAJOR_VERSION} qwt-qt5
112+
HINTS ${QT_LIBRARY_DIR}
113+
)
114+
115+
set ( QWT_LIBRARIES ${QWT_LIBRARY} )
116+
117+
# try to guess root dir from include dir
118+
if ( QWT_INCLUDE_DIR )
119+
string ( REGEX REPLACE "(.*)/include.*" "\\1" QWT_ROOT_DIR ${QWT_INCLUDE_DIR} )
120+
# try to guess root dir from library dir
121+
elseif ( QWT_LIBRARY )
122+
string ( REGEX REPLACE "(.*)/lib[/|32|64].*" "\\1" QWT_ROOT_DIR ${QWT_LIBRARY} )
123+
endif ()
124+
125+
# handle the QUIETLY and REQUIRED arguments
126+
include ( FindPackageHandleStandardArgs )
127+
if ( CMAKE_VERSION LESS 2.8.3 )
128+
find_package_handle_standard_args( Qwt DEFAULT_MSG QWT_LIBRARY QWT_INCLUDE_DIR _QWT_VERSION_MATCH )
129+
else ()
130+
find_package_handle_standard_args( Qwt REQUIRED_VARS QWT_LIBRARY QWT_INCLUDE_DIR _QWT_VERSION_MATCH VERSION_VAR QWT_VERSION_STRING )
131+
endif ()
132+
133+
mark_as_advanced (
134+
QWT_LIBRARY
135+
QWT_LIBRARIES
136+
QWT_INCLUDE_DIR
137+
QWT_INCLUDE_DIRS
138+
QWT_MAJOR_VERSION
139+
QWT_MINOR_VERSION
140+
QWT_PATCH_VERSION
141+
QWT_VERSION_STRING
142+
QWT_ROOT_DIR
143+
)
144+
145+
# =======================================================================================================================================
146+
# CEA (ajout de la cible qwt pour le "cmake modern") :
147+
set (QWT_TARGET "qwt::qwt")
148+
149+
add_library (${QWT_TARGET} SHARED IMPORTED)
150+
set_target_properties (qwt::qwt PROPERTIES
151+
INTERFACE_INCLUDE_DIRECTORIES ${QWT_INCLUDE_DIR}
152+
IMPORTED_LOCATION ${QWT_LIBRARIES}
153+
# INTERFACE_LINK_LIBRARIES ${QWT_LIBRARIES} # A priori on y met plutôt les dépendances, par exemple les libs Qt*.
154+
)
155+
# Fin CEA
156+
# =======================================================================================================================================

cmake/FindXercesC.cmake

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#
2+
# Charge le pkgconfig xerces-c
3+
#
4+
# Version 0.2
5+
#
6+
7+
# Le fichier fourni par cmake 3.24.2 ne suffit pas avec XercesC 4.0.0 :
8+
#CMake Error at /opt/cmake/3.24.2/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
9+
# Failed to find XercesC (missing: XercesC_LIBRARY XercesC_INCLUDE_DIR
10+
# XercesC_VERSION)
11+
#Call Stack (most recent call first):
12+
# /opt/cmake/3.24.2/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
13+
# /opt/cmake/3.24.2/share/cmake-3.24/Modules/FindXercesC.cmake:112 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
14+
# src/PrefsXerces/CMakeLists.txt:10 (find_package)
15+
# Le pkgconfig/xerces-c.pc est :
16+
# prefix=/opt22/xerces-c/4.0.0
17+
# exec_prefix=/opt22/xerces-c/4.0.0
18+
# libdir=/opt22/xerces-c/4.0.0/lib
19+
# includedir=/opt22/xerces-c/4.0.0/include
20+
#
21+
# Name: Xerces-C++
22+
# Description: Validating XML parser library for C++
23+
# Version: 4.0.0
24+
# Libs: -L/opt22/xerces-c/4.0.0/lib -lxerces-c
25+
# Libs.private:
26+
# Cflags: -I/opt22/xerces-c/4.0.0/include
27+
28+
set (XercesC_FOUND FALSE)
29+
30+
# Chargement du package pkgconfig xerces-c. Requiert qu'il soit accessible via
31+
# la variable d'environnement PKG_CONFIG_PATH :
32+
include(FindPkgConfig)
33+
pkg_check_modules (Xerces-C++ REQUIRED xerces-c)
34+
pkg_get_variable (XercesC_LIBRARY xerces-c xerces-c)
35+
pkg_get_variable (XercesC_VERSION xerces-c Version)
36+
pkg_get_variable (XercesC_INCLUDE_DIR xerces-c includedir)
37+
pkg_get_variable (XercesC_LIBRARIES xerces-c libraries)
38+
pkg_get_variable (XercesC_LIBDIR xerces-c libdir)
39+
pkg_get_variable (XercesC_PREFIX xerces-c prefix)
40+
41+
if (Xerces-C++_FOUND)
42+
set (XercesC_FOUND TRUE)
43+
endif ( )
44+
45+
if (NOT XercesC_LIBRARY)
46+
unset (XercesC_LIBRARY)
47+
find_library (XercesC_LIBRARY xerces-c ${XercesC_LIBDIR})
48+
endif ( )
49+
50+
set (XercesC_VERSION ${Xerces-C++_VERSION})
51+
set (XercesC_TARGET "XercesC::XercesC")
52+
if (NOT TARGET XercesC::XercesC)
53+
add_library (${XercesC_TARGET} SHARED IMPORTED)
54+
set_target_properties (XercesC::XercesC PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${XercesC_INCLUDE_DIR} IMPORTED_LOCATION ${XercesC_LIBRARY})
55+
endif( )
56+
set (XercesC_LIBRARY_DIRS ${XercesC_LIBDIR})
57+
set (XercesC_LIBRARIES ${XercesC_LIBRARY})
58+
59+
60+
MESSAGE (STATUS "========================== Module XercesC++ ========================== ")
61+
# Variables CMake prédéfinies :
62+
MESSAGE (STATUS "XercesC_PREFIX =" ${XercesC_PREFIX})
63+
MESSAGE (STATUS "XercesC_VERSION =" ${XercesC_VERSION})
64+
MESSAGE (STATUS "XercesC_INCLUDE_DIR =" ${XercesC_INCLUDE_DIR})
65+
MESSAGE (STATUS "XercesC_LIBDIR =" ${XercesC_LIBDIR})
66+
MESSAGE (STATUS "XercesC_LIBRARY_DIRS =" ${XercesC_LIBRARY_DIRS})
67+
MESSAGE (STATUS "XercesC_LIBRARY =" ${XercesC_LIBRARY})
68+
MESSAGE (STATUS "XercesC_LIBRARIES =" ${XercesC_LIBRARIES})
69+
MESSAGE (STATUS "XercesC_LINK_LIBRARIES=" ${XercesC_LINK_LIBRARIES})
70+
MESSAGE (STATUS "XercesC_CFLAGS =" ${XercesC_CFLAGS})
71+
MESSAGE (STATUS "XercesC_LDFLAGS =" ${XercesC_LDFLAGS})
72+
MESSAGE ("========================== Module Xerces-C++ ========================== ")
73+
74+
75+

0 commit comments

Comments
 (0)