Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions compositemodel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINAR

include(CMakePackageConfigHelpers)

target_include_directories(GoCompositeModel INTERFACE
$<BUILD_INTERFACE:${GoCompositeModel_SOURCE_DIR}/include>
)

export(TARGETS GoCompositeModel FILE GoCompositeModelTargets.cmake)

# 'install' target
IF(WIN32)
# Windows
Expand Down
7 changes: 7 additions & 0 deletions gotools-core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ ELSE(WIN32)
include(GNUInstallDirs)
ENDIF(WIN32)

target_include_directories(GoToolsCore INTERFACE
$<BUILD_INTERFACE:${GoToolsCore_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/newmat/include>
)

export(TARGETS GoToolsCore FILE GoToolsCoreTargets.cmake)

# Install the GoToolsCore target
install(TARGETS GoToolsCore
EXPORT GoToolsCoreTargets
Expand Down
6 changes: 6 additions & 0 deletions igeslib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ endif()

include(CMakePackageConfigHelpers)

target_include_directories(GoIgeslib INTERFACE
$<BUILD_INTERFACE:${GoIgeslib_SOURCE_DIR}/include>
)

export(TARGETS GoIgeslib FILE GoIgeslibTargets.cmake)

# 'install' target
IF(WIN32)
# Windows
Expand Down
6 changes: 6 additions & 0 deletions implicitization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ endif()

include(CMakePackageConfigHelpers)

target_include_directories(GoImplicitization INTERFACE
$<BUILD_INTERFACE:${GoImplicitization_SOURCE_DIR}/include>
)

export(TARGETS GoImplicitization FILE GoImplicitizationTargets.cmake)

# 'install' target
IF(WIN32)
# Windows
Expand Down
6 changes: 6 additions & 0 deletions intersections/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ ENDIF(GoTools_COMPILE_APPS)

include(CMakePackageConfigHelpers)

target_include_directories(GoIntersections INTERFACE
$<BUILD_INTERFACE:${GoIntersections_SOURCE_DIR}/include>
)

export(TARGETS GoIntersections FILE GoIntersectionsTargets.cmake)

# 'install' target
IF(WIN32)
# Windows
Expand Down
6 changes: 6 additions & 0 deletions isogeometric_model/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ endif()

include(CMakePackageConfigHelpers)

target_include_directories(GoIsogeometricModel INTERFACE
$<BUILD_INTERFACE:${GoIsogeometricModel_SOURCE_DIR}/include>
)

export(TARGETS GoIsogeometricModel FILE GoIsogeometricModelTargets.cmake)

# 'install' target
IF(WIN32)
# Windows
Expand Down
6 changes: 6 additions & 0 deletions lrsplines2D/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ ELSE(WIN32)
include(GNUInstallDirs)
ENDIF(WIN32)

target_include_directories(GoLRspline2D INTERFACE
$<BUILD_INTERFACE:${GoLRspline2D_SOURCE_DIR}/include>
)

export(TARGETS GoLRspline2D FILE GoLRsplines2DTargets.cmake)

# Install the GoLRspline2D target
install(TARGETS GoLRspline2D
EXPORT GoLRspline2DTargets
Expand Down
6 changes: 6 additions & 0 deletions lrsplines3D/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ ELSE(WIN32)
include(GNUInstallDirs)
ENDIF(WIN32)

target_include_directories(GoLRspline3D INTERFACE
$<BUILD_INTERFACE:${GoLRspline3D_SOURCE_DIR}/include>
)

export(TARGETS GoLRspline3D FILE GoLRsplines3DTargets.cmake)

# Install the GoLRspline2D target
install(TARGETS GoLRspline3D
EXPORT GoLRspline3DTargets
Expand Down
6 changes: 6 additions & 0 deletions newmat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ ENDIF()
# === Install Targets and Export CMake Package ===
include(CMakePackageConfigHelpers)

target_include_directories(newmat INTERFACE
$<BUILD_INTERFACE:${newmat_SOURCE_DIR}/include>
)

export(TARGETS newmat FILE newmatTargets.cmake)

# Install the newmat target with export
install(TARGETS newmat
EXPORT NewmatTargets
Expand Down
6 changes: 6 additions & 0 deletions parametrization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ endif()

include(CMakePackageConfigHelpers)

target_include_directories(parametrization INTERFACE
$<BUILD_INTERFACE:${parametrization_SOURCE_DIR}/include>
)

export(TARGETS parametrization FILE parametrizationTargets.cmake)

# 'install' target
IF(WIN32)
# Windows
Expand Down
6 changes: 6 additions & 0 deletions qualitymodule/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ ENDIF(GoTools_COMPILE_TESTS)

include(CMakePackageConfigHelpers)

target_include_directories(GoQualityModule INTERFACE
$<BUILD_INTERFACE:${GoQualityModule_SOURCE_DIR}/include>
)

export(TARGETS GoQualityModule FILE GoQualityModuleTargets.cmake)

# 'install' target
IF(WIN32)
# Windows
Expand Down
2 changes: 1 addition & 1 deletion sisl
Submodule sisl updated 1 files
+6 −0 CMakeLists.txt
6 changes: 6 additions & 0 deletions topology/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ ENDIF(GoTools_COMPILE_TESTS)

include(CMakePackageConfigHelpers)

target_include_directories(GoTopology INTERFACE
$<BUILD_INTERFACE:${GoTopology_SOURCE_DIR}/include>
)

export(TARGETS GoTopology FILE GoTopologyTargets.cmake)

# 'install' target
IF(WIN32)
# Windows
Expand Down
7 changes: 7 additions & 0 deletions trivariate/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ install(DIRECTORY include/
FILES_MATCHING PATTERN "*.h"
)

target_include_directories(GoTrivariate INTERFACE
$<BUILD_INTERFACE:${GoTrivariate_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${GoToolsCore_SOURCE_DIR}/include>
)

export(TARGETS GoTrivariate FILE GoTrivariateTargets.cmake)

# Export the targets to a file
install(EXPORT GoTrivariateTargets
FILE GoTrivariateTargets.cmake
Expand Down
6 changes: 6 additions & 0 deletions trivariatemodel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ endif()

include(CMakePackageConfigHelpers)

target_include_directories(GoTrivariateModel INTERFACE
$<BUILD_INTERFACE:${GoTrivariateModel_SOURCE_DIR}/include>
)

export(TARGETS GoTrivariateModel FILE GoTrivariateModelTargets.cmake)

# 'install' target
IF(WIN32)
# Windows
Expand Down
2 changes: 1 addition & 1 deletion ttl
Submodule ttl updated 1 files
+6 −0 CMakeLists.txt
140 changes: 86 additions & 54 deletions viewlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -286,60 +286,92 @@ endif(ViewlibVolAndLRSupport)
# Create a tmp dir for generated data.
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/tmp)

# 'install' target
if(WIN32)
# === Install Targets and Export Package ===

include(CMakePackageConfigHelpers)

# 1. Setup Installation Paths
IF(WIN32)
# Windows
# lib
install(TARGETS viewlib DESTINATION ${GoTools_INSTALL_PREFIX}/lib)
# include
install(DIRECTORY include/GoTools/viewlib
DESTINATION ${GoTools_INSTALL_PREFIX}/include/GoTools
FILES_MATCHING PATTERN "*.h"
PATTERN ".svn" EXCLUDE
)
# include ui files
install(DIRECTORY ${viewlib_BINARY_DIR}/include/GoTools/viewlib/
DESTINATION ${GoTools_INSTALL_PREFIX}/include/GoTools/viewlib
FILES_MATCHING PATTERN "ui_*_form.h"
PATTERN ".svn" EXCLUDE
)
# data
install(DIRECTORY data/
DESTINATION ${GoTools_INSTALL_PREFIX}/share/viewlib
FILES_MATCHING PATTERN "*.g2" PATTERN "*.igs"
PATTERN ".svn" EXCLUDE
)
# bin
set(goview_INSTALL_PREFIX "$ENV{PROGRAMFILES}/SINTEF/goview"
CACHE PATH "Path to install goview")
install(TARGETS goview DESTINATION ${goview_INSTALL_PREFIX})
else()
# Note: Ensure GoTools_WINDOWS_INSTALL_PREFIX is defined in your root CMakeLists or cache
set(CMAKE_INSTALL_LIBDIR ${GoTools_WINDOWS_INSTALL_PREFIX}/lib)
set(CMAKE_INSTALL_INCLUDEDIR ${GoTools_WINDOWS_INSTALL_PREFIX}/include)
set(CMAKE_INSTALL_BINDIR ${GoTools_WINDOWS_INSTALL_PREFIX}/bin)
set(CMAKE_INSTALL_DATADIR ${GoTools_WINDOWS_INSTALL_PREFIX}/share)
ELSE(WIN32)
# Linux
# lib
install(TARGETS viewlib DESTINATION lib COMPONENT viewlib)
# include
install(DIRECTORY include/GoTools/viewlib
DESTINATION include/GoTools
COMPONENT viewlib-dev
FILES_MATCHING PATTERN "*.h"
PATTERN ".svn" EXCLUDE
)
# include ui files
install(DIRECTORY ${viewlib_BINARY_DIR}/include/GoTools/viewlib/
DESTINATION include/GoTools/viewlib
COMPONENT viewlib-dev
FILES_MATCHING PATTERN "ui_*_form.h"
PATTERN ".svn" EXCLUDE
)
# data
install(DIRECTORY data/
DESTINATION share/GoTools/viewlib
COMPONENT viewlib
FILES_MATCHING PATTERN "*.g2" PATTERN "*.igs"
PATTERN ".svn" EXCLUDE
)
# bin
install(TARGETS goview DESTINATION bin COMPONENT viewlib)
endif()
include(GNUInstallDirs)
ENDIF(WIN32)

# 2. Define Interface Include Directories for the Build Tree
target_include_directories(viewlib INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
# If viewlib relies on other internal headers, add them here
)

# 3. Export Targets to Build Tree
export(TARGETS viewlib FILE viewlibTargets.cmake)

# 4. Install Targets (Library and Executable)
# This handles both the library (viewlib) and the app (goview)
install(TARGETS viewlib goview
EXPORT viewlibTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

# 5. Install Headers
# Standard headers
install(DIRECTORY include/GoTools/viewlib
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/GoTools
FILES_MATCHING PATTERN "*.h"
PATTERN ".svn" EXCLUDE
)

# Generated UI headers (from binary dir)
install(DIRECTORY ${viewlib_BINARY_DIR}/include/GoTools/viewlib/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/GoTools/viewlib
FILES_MATCHING PATTERN "ui_*_form.h"
PATTERN ".svn" EXCLUDE
)

# 6. Install Data Files
install(DIRECTORY data/
DESTINATION ${CMAKE_INSTALL_DATADIR}/GoTools/viewlib
FILES_MATCHING PATTERN "*.g2" PATTERN "*.igs"
PATTERN ".svn" EXCLUDE
)

# 7. Install Export File (for use by other projects)
install(EXPORT viewlibTargets
FILE viewlibTargets.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/viewlib
)

# 8. Generate Version File
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/viewlibConfigVersion.cmake"
# Assuming viewlib shares the GoTools version, otherwise change to ${viewlib_VERSION...}
VERSION ${GoTools_VERSION_MAJOR}.${GoTools_VERSION_MINOR}.${GoTools_VERSION_PATCH}
COMPATIBILITY SameMajorVersion
)

# 9. Generate Config File from Template
# Ensure you have a 'viewlibConfig.cmake.in' in your 'cmake/' folder
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/viewlibConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/viewlibConfig.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/viewlib
)

# 10. Install the Config Files
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/viewlibConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/viewlibConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/viewlib
)

set(CPACK_STRIP_FILES ${CPACK_STRIP_FILES} libviewlib.so)
# Optional stripping
SET(CPACK_STRIP_FILES ${CPACK_STRIP_FILES} libviewlib.so)
5 changes: 3 additions & 2 deletions viewlib/cmake/viewlibConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

include("${CMAKE_CURRENT_LIST_DIR}/viewlibTargets.cmake")

set(VIEWLIB_INCLUDE_DIRS "@CMAKE_INSTALL_INCLUDEDIR@")
# Legacy compatibility
set(VIEWLIB_LIBRARIES viewlib)

check_required_components(viewlib)
# Optionally set variables
set(VIEWLIB_INCLUDE_DIRS "@CMAKE_INSTALL_INCLUDEDIR@/include")