Salome HOME
bos #37534:
[modules/gui.git] / src / SalomeApprc_utils / CMakeLists.txt
1 # Copyright (C) 2012-2022  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 # Common CMake macros
21 # ===================
22 SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake configuration files")
23 IF(EXISTS ${CONFIGURATION_ROOT_DIR})
24   LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake")
25   INCLUDE(SalomeMacros NO_POLICY_SCOPE)
26 ELSE()
27   MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
28 ENDIF()
29
30 FIND_PACKAGE(SalomeQt5)
31
32 # additional include directories
33 INCLUDE_DIRECTORIES(
34   ${QT_INCLUDES}
35   ${PROJECT_SOURCE_DIR}/src/Qtx
36   ${PROJECT_SOURCE_DIR}/src/SUIT
37 )
38 # additional preprocessor / compiler flags
39 ADD_DEFINITIONS(${QT_DEFINITIONS} ${PYTHON_DEFINITIONS})
40
41 # libraries to link to
42 SET(_link_LIBRARIES ${QT_LIBRARIES} qtx suit)
43
44 ## --- headers ---
45 #
46 # header files / to be processed by moc
47 SET(_moc_HEADERS   
48   SalomeApprc_utils.h
49 )
50 #
51 # header files / to install
52 SET(SalomeApprc_utils_HEADERS ${_moc_HEADERS})
53
54 # sources / moc wrappings
55 QT5_WRAP_CPP(_moc_SOURCES SalomeApprc_utils.cxx)
56
57 # --- rules ---
58
59 ADD_LIBRARY(SalomeApprc_utils SalomeApprc_utils.cxx)
60 TARGET_LINK_LIBRARIES(SalomeApprc_utils ${_link_LIBRARIES})
61 INSTALL(TARGETS SalomeApprc_utils EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
62
63 if(WIN32)
64    MESSAGE(STATUS "Add SalomeApprc_utils static library")
65   add_library(SalomeApprc_utils_lib STATIC  SalomeApprc_utils.cxx)
66   TARGET_LINK_LIBRARIES(SalomeApprc_utils_lib ${_link_LIBRARIES})
67   set_target_properties(SalomeApprc_utils_lib PROPERTIES OUTPUT_NAME SalomeApprc_utils)
68   INSTALL(TARGETS SalomeApprc_utils_lib DESTINATION ${SALOME_INSTALL_LIBS})
69 endif(WIN32)
70
71 INSTALL(FILES ${SalomeApprc_utils_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})