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

(cmake) Install GeoModelXml and GMXPlugin a parts of GeoModelTools

parent a2f0b367
No related branches found
No related tags found
1 merge request!67Bringing GeoModelXML into GeoModel
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
cmake_minimum_required( VERSION 3.12 ) cmake_minimum_required( VERSION 3.12 )
# Set up the project. # Set up the project.
project( "GMX" VERSION 1.0.0 LANGUAGES CXX ) #project( "GMX" VERSION 1.0.0 LANGUAGES CXX )
# By default prefer not to use frameworks on macOS. # By default prefer not to use frameworks on macOS.
# But use it at a "LAST" resource, if no other options worked. # But use it at a "LAST" resource, if no other options worked.
# For details on the behaviour of this cache variable, see: # For details on the behaviour of this cache variable, see:
# - https://cmake.org/cmake/help/v3.0/command/find_file.html # - https://cmake.org/cmake/help/v3.0/command/find_file.html
set( CMAKE_FIND_FRAMEWORK "LAST" CACHE STRING #set( CMAKE_FIND_FRAMEWORK "LAST" CACHE STRING
"Framework finding behaviour on macOS" ) #"Framework finding behaviour on macOS" )
# --- Add sub-projects --- # --- Add sub-projects ---
...@@ -19,41 +19,41 @@ add_subdirectory(GMXPlugin) ...@@ -19,41 +19,41 @@ add_subdirectory(GMXPlugin)
# -- Export & Install the project -- # -- Export & Install the project --
# Create and install the version description of the project. # Create and install the version description of the project.
include( WriteBasicConfigVersionFile ) #include( WriteBasicConfigVersionFile )
write_basic_config_version_file( #write_basic_config_version_file(
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}ConfigVersion.cmake #${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}ConfigVersion.cmake
VERSION ${PROJECT_VERSION} #VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion ) #COMPATIBILITY SameMajorVersion )
install( #install(
FILES #FILES
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}ConfigVersion.cmake #${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}ConfigVersion.cmake
COMPONENT Development #COMPONENT Development
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ) #DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} )
# Create and install the description of the libraries. # Create and install the description of the libraries.
export( EXPORT ${PROJECT_NAME}-export #export( EXPORT ${PROJECT_NAME}-export
NAMESPACE "${PROJECT_NAME}::" #NAMESPACE "${PROJECT_NAME}::"
FILE ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}Targets.cmake ) #FILE ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}Targets.cmake )
install( EXPORT ${PROJECT_NAME}-export #install( EXPORT ${PROJECT_NAME}-export
FILE ${PROJECT_NAME}Targets.cmake #FILE ${PROJECT_NAME}Targets.cmake
COMPONENT Development #COMPONENT Development
NAMESPACE "${PROJECT_NAME}::" #NAMESPACE "${PROJECT_NAME}::"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ) #DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} )
# Install the hand-written project configuration. # Install the hand-written project configuration.
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/GMXConfig.cmake.in #configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/GMXConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}Config.cmake # ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}Config.cmake
@ONLY ) # @ONLY )
install( #install(
FILES #FILES
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}Config.cmake #${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}Config.cmake
COMPONENT Development #COMPONENT Development
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ) #DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} )
# Set up the packaging of the project using CPack. # Set up the packaging of the project using CPack.
list( APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ) #list( APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake )
include( GMXPackaging ) #include( GMXPackaging )
...@@ -12,7 +12,9 @@ find_package( ZLIB REQUIRED ) ...@@ -12,7 +12,9 @@ find_package( ZLIB REQUIRED )
# Create the library. # Create the library.
add_library( GeoModelXml SHARED ${HEADERS} ${SOURCES} ) add_library( GeoModelXml SHARED ${HEADERS} ${SOURCES} )
# Add custom definitions
target_compile_definitions( GeoModelXml PUBLIC -DSTANDALONE_GMX ) target_compile_definitions( GeoModelXml PUBLIC -DSTANDALONE_GMX )
# link libraries
target_link_libraries( GeoModelXml PUBLIC GeoModelCore::GeoModelKernel GeoModelTools::ExpressionEvaluator XercesC::XercesC ZLIB::ZLIB ) target_link_libraries( GeoModelXml PUBLIC GeoModelCore::GeoModelKernel GeoModelTools::ExpressionEvaluator XercesC::XercesC ZLIB::ZLIB )
target_include_directories( GeoModelXml PUBLIC target_include_directories( GeoModelXml PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
...@@ -44,7 +46,7 @@ install(TARGETS GeoModelXml ...@@ -44,7 +46,7 @@ install(TARGETS GeoModelXml
install( FILES ${HEADERS} install( FILES ${HEADERS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/GeoModelXml DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/GeoModelXml
COMPONENT Development ) COMPONENT Development )
install( FILES ${SHAPEHEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/GeoModelXml/shape) install( FILES ${SHAPEHEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/GeoModelXml/shape)
...@@ -7,7 +7,7 @@ find_dependency( GeoModelTools @GeoModelTools_VERSION@ CONFIG EXACT ) ...@@ -7,7 +7,7 @@ find_dependency( GeoModelTools @GeoModelTools_VERSION@ CONFIG EXACT )
find_dependency( XercesC @XercesC_VERSION@ ) find_dependency( XercesC @XercesC_VERSION@ )
find_dependency( ZLIB @ZLIB_VERSION@ ) find_dependency( ZLIB @ZLIB_VERSION@ )
# Include the exported configuration of GeoModelCore. # Include the exported configuration
get_filename_component( SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH ) get_filename_component( SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH )
include( ${SELF_DIR}/GMXTargets.cmake ) include( ${SELF_DIR}/GMXTargets.cmake )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment