diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ab2a7d2..ef0ee424 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,8 +3,6 @@ if(NOT CMAKE_BUILD_TYPE) endif(NOT CMAKE_BUILD_TYPE) cmake_minimum_required(VERSION 3.1.3) -include ( CMakePackageConfigHelpers ) - if(NOT WIN32) option( USE_NATIVE_ARCH "build which -march=native" ON) endif(NOT WIN32) @@ -458,19 +456,8 @@ add_custom_target(uninstall # Generate package config file get_directory_property(NETGEN_COMPILE_DEFINITIONS COMPILE_DEFINITIONS) -# use relative paths to libraries (needed on Windows/MacOS, when we provide some dependencies ourselves) -list(APPEND CONFIGURE_PATH_VARS ZLIB_INCLUDE_DIRS ZLIB_LIBRARIES) -if(USE_OCC) -list(APPEND CONFIGURE_PATH_VARS OCC_INCLUDE_DIR OCC_LIBRARIES_BIN OCC_LIBRARIES OCC_LIBRARY_DIR) -endif() -if(USE_GUI) -list(APPEND CONFIGURE_PATH_VARS TCL_INCLUDE_PATH TCL_LIBRARY TK_INCLUDE_PATH TK_LIBRARY LIBTOGL) -endif() -configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/NetgenConfig.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/NetgenConfig.cmake INSTALL_DESTINATION ${NG_INSTALL_DIR_CMAKE} - PATH_VARS - ${CONFIGURE_PATH_VARS} - ) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/NetgenConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/NetgenConfig.cmake @ONLY ESCAPE_QUOTES) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/NetgenConfig.cmake DESTINATION ${NG_INSTALL_DIR_CMAKE} COMPONENT netgen_devel) diff --git a/cmake/NetgenConfig.cmake.in b/cmake/NetgenConfig.cmake.in index 43f67920..4c5217b8 100644 --- a/cmake/NetgenConfig.cmake.in +++ b/cmake/NetgenConfig.cmake.in @@ -1,5 +1,3 @@ -@PACKAGE_INIT@ - set(NETGEN_VERSION "@NETGEN_VERSION@") get_filename_component(NETGEN_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) @@ -27,23 +25,23 @@ set(NETGEN_METIS_LIBRARY "@METIS_LIBRARY@") set(NETGEN_MKL_LIBRARIES "@MKL_LIBRARIES@") set(NETGEN_MPI_CXX_INCLUDE_PATH "@MPI_CXX_INCLUDE_PATH@") set(NETGEN_MPI_CXX_LIBRARIES "@MPI_CXX_LIBRARIES@") -set(NETGEN_OCC_INCLUDE_DIR "@PACKAGE_OCC_INCLUDE_DIR@") -set(NETGEN_OCC_LIBRARIES_BIN "@PACKAGE_OCC_LIBRARIES_BIN@") -set(NETGEN_OCC_LIBRARIES "@PACKAGE_OCC_LIBRARIES@") -set(NETGEN_OCC_LIBRARY_DIR "@PACKAGE_OCC_LIBRARY_DIR@") +set(NETGEN_OCC_INCLUDE_DIR "@OCC_INCLUDE_DIR@") +set(NETGEN_OCC_LIBRARIES_BIN "@OCC_LIBRARIES_BIN@") +set(NETGEN_OCC_LIBRARIES "@OCC_LIBRARIES@") +set(NETGEN_OCC_LIBRARY_DIR "@OCC_LIBRARY_DIR@") set(NETGEN_OPENGL_LIBRARIES "@OPENGL_LIBRARIES@") set(NETGEN_PYTHON_EXECUTABLE "@PYTHON_EXECUTABLE@") set(NETGEN_PYTHON_INCLUDE_DIRS "@PYTHON_INCLUDE_DIRS@") set(NETGEN_PYTHON_LIBRARIES "@PYTHON_LIBRARIES@") -set(NETGEN_TCL_INCLUDE_PATH "@PACKAGE_TCL_INCLUDE_PATH@") -set(NETGEN_TCL_LIBRARY "@PACKAGE_TCL_LIBRARY@") +set(NETGEN_TCL_INCLUDE_PATH "@TCL_INCLUDE_PATH@") +set(NETGEN_TCL_LIBRARY "@TCL_LIBRARY@") set(NETGEN_TK_DND_LIBRARY "@TK_DND_LIBRARY@") set(NETGEN_TK_INCLUDE_PATH "@TK_INCLUDE_PATH@") set(NETGEN_TK_LIBRARY "@TK_LIBRARY@") set(NETGEN_X11_X11_LIB "@X11_X11_LIB@") set(NETGEN_X11_Xmu_LIB "@X11_Xmu_LIB@") -set(NETGEN_ZLIB_INCLUDE_DIRS "@PACKAGE_ZLIB_INCLUDE_DIRS@") -set(NETGEN_ZLIB_LIBRARIES "@PACKAGE_ZLIB_LIBRARIES@") +set(NETGEN_ZLIB_INCLUDE_DIRS "@ZLIB_INCLUDE_DIRS@") +set(NETGEN_ZLIB_LIBRARIES "@ZLIB_LIBRARIES@") set(NETGEN_USE_GUI @USE_GUI@) set(NETGEN_USE_PYTHON @USE_PYTHON@)