mirror of https://github.com/CGAL/cgal
Added macros to properly arranged tagged libraries listings
This commit is contained in:
parent
6f5963131b
commit
09cc8a35db
|
|
@ -16,9 +16,14 @@ macro(create_single_source_cgal_program first )
|
|||
|
||||
# Link the executable to CGAL and third-party libraries
|
||||
if ( CGAL_AUTO_LINK_ENABLED )
|
||||
|
||||
target_link_libraries(${exe_name} ${CGAL_3RD_PARTY_LIBRARIES} )
|
||||
|
||||
else()
|
||||
target_link_libraries(${exe_name} ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} )
|
||||
|
||||
target_link_libraries(${exe_name} ${CGAL_LIBRARIES} )
|
||||
target_link_libraries(${exe_name} ${CGAL_3RD_PARTY_LIBRARIES} )
|
||||
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -12,28 +12,63 @@ if( NOT CGAL_MACROS_FILE_INCLUDED )
|
|||
endmacro()
|
||||
|
||||
macro( cache_set var )
|
||||
if ( "${ARGC}" GREATER "1" )
|
||||
set ( ${var} ${ARGN} CACHE INTERNAL "" )
|
||||
set ( ${var} ${ARGN} CACHE INTERNAL "" )
|
||||
endif()
|
||||
set ( ${var} ${ARGN} CACHE INTERNAL "" )
|
||||
set ( ${var} ${ARGN} CACHE INTERNAL "" )
|
||||
endmacro()
|
||||
|
||||
macro( typed_cache_set type doc var )
|
||||
if ( "${ARGC}" GREATER "1" )
|
||||
set ( ${var} ${ARGN} CACHE ${type} ${doc} FORCE )
|
||||
set ( ${var} ${ARGN} CACHE ${type} ${doc} FORCE )
|
||||
endif()
|
||||
set ( ${var} ${ARGN} CACHE ${type} ${doc} FORCE )
|
||||
set ( ${var} ${ARGN} CACHE ${type} ${doc} FORCE )
|
||||
endmacro()
|
||||
|
||||
macro( cache_get var )
|
||||
set ( ${var} )
|
||||
endmacro()
|
||||
|
||||
|
||||
# Splits inlist in the first element (head) and the rest (tail)
|
||||
macro( list_split head tail )
|
||||
set( ${head} )
|
||||
set( ${tail} )
|
||||
set( _LS_is_head TRUE )
|
||||
foreach( _LS_item ${ARGN} )
|
||||
if ( _LS_is_head )
|
||||
set( ${head} ${_LS_item} )
|
||||
set( _LS_is_head FALSE )
|
||||
else()
|
||||
list( APPEND ${tail} ${_LS_item} )
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
# adds elements to an internal cached list
|
||||
macro( add_to_cached_list listname )
|
||||
cache_get ( ${listname} )
|
||||
cache_set ( ${listname} ${${listname}} ${ARGN} )
|
||||
set( _ATC_${listname}_tmp ${${listname}} )
|
||||
if ( NOT "${ARGN}" STREQUAL "" )
|
||||
list( APPEND _ATC_${listname}_tmp ${ARGN} )
|
||||
endif()
|
||||
cache_set ( ${listname} ${_ATC_${listname}_tmp} )
|
||||
endmacro()
|
||||
|
||||
# adds elements to an in-memory variable named 'listname'
|
||||
macro( add_to_memory_list listname )
|
||||
if ( NOT "${ARGN}" STREQUAL "" )
|
||||
list( APPEND ${listname} ${ARGN} )
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# adds elements to a list.
|
||||
# If the first argument after 'listname' is PERSISTENT then 'listname'
|
||||
# is a persistent internal cached variable, otherwise is a memory variable.
|
||||
macro( add_to_list listname )
|
||||
list_split( _ATL_ARGN_HEAD _ATL_ARGN_TAIL ${ARGN} )
|
||||
if ( "${_ATL_ARGN_HEAD}" STREQUAL "PERSISTENT" )
|
||||
add_to_cached_list( ${listname} ${_ATL_ARGN_TAIL} )
|
||||
else()
|
||||
add_to_memory_list( ${listname} ${ARGN} )
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro( at list idx var )
|
||||
list( LENGTH ${list} ${list}_length )
|
||||
if ( ${idx} LESS ${${list}_length} )
|
||||
|
|
@ -144,4 +179,200 @@ if( NOT CGAL_MACROS_FILE_INCLUDED )
|
|||
endif()
|
||||
endmacro()
|
||||
|
||||
# Composes a tagged list of libraries: a list with interpersed keywords or tags
|
||||
# indicating that all following libraries, up to the next tag, are to be linked only for the
|
||||
# corresponding build type. The 'general' tag indicates libraries that corresponds to all build types.
|
||||
# 'optimized' corresponds to release builds and 'debug' to debug builds. Tags are case sensitve and
|
||||
# the inital range of libraries listed before any tag is implicitely 'general'
|
||||
#
|
||||
# This macro takes 3 lists of general, optimized and debug libraries, resp, and populates the list
|
||||
# given in the fourth argument.
|
||||
#
|
||||
# The first three parameters must be strings containing a semi-colon separated list of elements.
|
||||
# All three lists must be passed, but any of them can be an empty string "".
|
||||
# The fourth parameter, corresponding to the result, must be a variable name and it will be APPENDED
|
||||
# (retaining any previous contents)
|
||||
#
|
||||
# If there is a last parameter whose value is "PERSISTENT" then the result is an internal cached variable,
|
||||
# otherwise it is an in-memory variable
|
||||
#
|
||||
macro( compose_tagged_libraries libs_general libs_optimized libs_debug libs )
|
||||
|
||||
if ( "${ARGN}" STREQUAL "PERSISTENT" )
|
||||
set( _CTL_IN_CACHE "PERSISTENT" )
|
||||
else()
|
||||
set( _CTL_IN_CACHE )
|
||||
endif()
|
||||
|
||||
if ( NOT "${libs_general}" STREQUAL "" )
|
||||
add_to_list( ${libs} ${_CTL_IN_CACHE} ${libs_general} )
|
||||
endif()
|
||||
|
||||
if ( NOT "${libs_optimized}" STREQUAL "" )
|
||||
add_to_list( ${libs} ${_CTL_IN_CACHE} optimized ${libs_optimized} )
|
||||
endif()
|
||||
|
||||
if ( NOT "${libs_debug}" STREQUAL "" )
|
||||
add_to_list( ${libs} ${_CTL_IN_CACHE} debug ${libs_debug} )
|
||||
endif()
|
||||
|
||||
endmacro()
|
||||
|
||||
# Decomposes a tagged list of libraries (see macro compose_tagged_libraries).
|
||||
# The first argument is the tagged list and the next 3 arguments are the lists
|
||||
# where the general, optimized and debug libraries are collected.
|
||||
#
|
||||
# The first parameter must be a string containing a semi-colon separated list of elements.
|
||||
# It cannot be ommitted, but it can be an empty string ""
|
||||
#
|
||||
# TThe next three arguments must be the names of the variables containing the result, and they
|
||||
# will be APPENDED (retaining any previous contents)
|
||||
#
|
||||
# If there is a last parameter whose value is "PERSISTENT" then the result variables are internal in the cache,
|
||||
# otherwise they are in-memory.
|
||||
#
|
||||
macro( decompose_tagged_libraries libs libs_general libs_optimized libs_debug )
|
||||
|
||||
if ( "${ARGN}" STREQUAL "PERSISTENT" )
|
||||
set( _DTL_IN_CACHE "PERSISTENT" )
|
||||
else()
|
||||
set( _DTL_IN_CACHE )
|
||||
endif()
|
||||
|
||||
set( _DTL_tag general )
|
||||
|
||||
foreach( _DTL_lib ${libs} )
|
||||
|
||||
if ( "${_DTL_lib}" STREQUAL "general" OR "${_DTL_lib}" STREQUAL "optimized" OR "${_DTL_lib}" STREQUAL "debug" )
|
||||
|
||||
set( _DTL_tag "${_DTL_lib}" )
|
||||
|
||||
else()
|
||||
|
||||
if ( "${_DTL_tag}" STREQUAL "general" )
|
||||
set( _DTL_target ${libs_general} )
|
||||
elseif ( "${_DTL_tag}" STREQUAL "optimized" )
|
||||
set( _DTL_target ${libs_optimized} )
|
||||
else()
|
||||
set( _DTL_target ${libs_debug} )
|
||||
endif()
|
||||
|
||||
add_to_list( ${_DTL_target} ${_DTL_IN_CACHE} ${_DTL_lib} )
|
||||
|
||||
endif()
|
||||
|
||||
endforeach()
|
||||
|
||||
endmacro()
|
||||
|
||||
# Given lists of optimized and debug libraries, creates a tagged list which will
|
||||
# contain the libraries listed in the 'general' section if any of the two lists is empty,
|
||||
#
|
||||
# All arguments are variable names (not values), thus the input list can be undefined or empty.
|
||||
# The return variable ('libs') will be APPENDED the result (retaining any previous contents)
|
||||
#
|
||||
# If there is a last parameter whose value is "PERSISTENT" then the result is an internal cached variable,
|
||||
# otherwise it is an in-memory variable
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# set( LIBS_1 libA.so libB.so )
|
||||
# set( LIBS_2 libC.so )
|
||||
#
|
||||
# tag_libraries( LIBS_1 LIBS_2 LIBS_R )
|
||||
#
|
||||
# LIBS_R -> optimized;libA.so;libB.so;debug;libC.so
|
||||
#
|
||||
# tag_libraries( LIBS_1 SOME_UNDEFINED_VARIABLE_OR_EMPTY_LIST LIBS_R )
|
||||
#
|
||||
# LIBS_R -> libA.so;libB.so (implicitely 'general' since there is no tag)
|
||||
#
|
||||
# tag_libraries( SOME_UNDEFINED_VARIABLE_OR_EMPTY_LIST LIBS_2 LIBS_R )
|
||||
#
|
||||
# LIBS_R -> libC.so (implicitely 'general' since there is no tag)
|
||||
#
|
||||
macro( tag_libraries libs_general_or_optimized libs_general_or_debug libs )
|
||||
|
||||
list( LENGTH ${libs_general_or_optimized} _TL_libs_general_or_optimized_len )
|
||||
list( LENGTH ${libs_general_or_debug} _TL_libs_general_or_debug_len )
|
||||
|
||||
if ( _TL_libs_general_or_optimized_len EQUAL 0 )
|
||||
compose_tagged_libraries( "${${libs_general_or_debug}}" "" "" ${libs} ${ARGN} )
|
||||
elseif ( _TL_libs_general_or_debug_len EQUAL 0 )
|
||||
compose_tagged_libraries( "${${libs_general_or_optimized}}" "" "" ${libs} ${ARGN} )
|
||||
else()
|
||||
compose_tagged_libraries( "" "${${libs_general_or_optimized}}" "${${libs_general_or_debug}}" ${libs} ${ARGN} )
|
||||
endif()
|
||||
|
||||
endmacro()
|
||||
|
||||
# add_to_tagged_libraries( libsR ${libsA} <PERSISTENT> )
|
||||
#
|
||||
# Appends the list of tagged libraries contained in the variable 'libA' to the list
|
||||
# of tagged libraries contained in the variable 'libR', properly redistributing each tagged subsequence.
|
||||
#
|
||||
# The first argument is the name of the variable recieving the list. It will be APPENDED
|
||||
# (retaining any previous contents).
|
||||
# The second parameter is a single string value containing the tagged
|
||||
# lists of libraries to append (as a semi-colon separated list). It can be empty, in which case noting is added.
|
||||
#
|
||||
# If there is a third parameter whose value is PERSISTENT, then 'libR' is an internal cached variable, otherwise
|
||||
# it is an in-memory variable.
|
||||
#
|
||||
# It is not possible to append more than one list in the same call.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# set( LIBS_1 libG0.so libG1.so optimized libO0.so)
|
||||
# set( LIBS_2 libG2.so debug libD0.so)
|
||||
# set( LIBS_3 debug libD1.so optimized libO1.so libO2.so )
|
||||
#
|
||||
# concat_tagged_libraries( LIBS_R ${LIBS_1} PERSISTENT )
|
||||
# concat_tagged_libraries( LIBS_R ${LIBS_2} PERSISTENT )
|
||||
# concat_tagged_libraries( LIBS_R ${LIBS_3} PERSISTENT )
|
||||
#
|
||||
# LIBS_R -> libG0.so;libG1.so;libG2.so;optimized;libO0.so;libO1.so;libO2.so;debug;libD0.so;libD1.so, in the cache
|
||||
#
|
||||
macro( add_to_tagged_libraries libsR in_cache libsA )
|
||||
|
||||
if ( "${in_cache}" STREQUAL "PERSISTENT" )
|
||||
set( _CTL_IN_CACHE "PERSISTENT" )
|
||||
else()
|
||||
set( _CTL_IN_CACHE )
|
||||
endif()
|
||||
|
||||
set( _CTL_general_0 )
|
||||
set( _CTL_optimized_0 )
|
||||
set( _CTL_debug_0 )
|
||||
set( _CTL_general_1 )
|
||||
set( _CTL_optimized_1 )
|
||||
set( _CTL_debug_0 )
|
||||
|
||||
decompose_tagged_libraries( "${${libsR}}" _CTL_general_0 _CTL_optimized_0 _CTL_debug_0 )
|
||||
decompose_tagged_libraries( "${libsA}" _CTL_general_1 _CTL_optimized_1 _CTL_debug_1 )
|
||||
|
||||
add_to_list( _CTL_general_0 ${_CTL_general_1} )
|
||||
add_to_list( _CTL_optimized_0 ${_CTL_optimized_1} )
|
||||
add_to_list( _CTL_debug_0 ${_CTL_debug_1} )
|
||||
|
||||
if ( "${_CTL_IN_CACHE}" STREQUAL "PERSISTENT" )
|
||||
cache_set( ${libsR} )
|
||||
else()
|
||||
set( ${libsR} )
|
||||
endif()
|
||||
|
||||
compose_tagged_libraries( "${_CTL_general_0}" "${_CTL_optimized_0}" "${_CTL_debug_0}" ${libsR} ${_CTL_IN_CACHE} )
|
||||
|
||||
endmacro()
|
||||
|
||||
|
||||
macro( add_to_persistent_tagged_libraries libsR )
|
||||
add_to_tagged_libraries( ${libsR} PERSISTENT "${ARGN}" )
|
||||
endmacro()
|
||||
|
||||
macro( add_to_in_memory_tagged_libraries libsR )
|
||||
add_to_tagged_libraries( ${libsR} NOT_PERSISTENT "${ARGN}" )
|
||||
endmacro()
|
||||
|
||||
|
||||
endif()
|
||||
|
|
@ -19,12 +19,12 @@ if ( NOT CGAL_Boost_Setup )
|
|||
|
||||
include(CGAL_Macros)
|
||||
|
||||
cache_set(CGAL_3RD_PARTY_INCLUDE_DIRS ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} )
|
||||
cache_set(CGAL_3RD_PARTY_LIBRARIES_DIRS ${CGAL_3RD_PARTY_LIBRARIES_DIRS} ${Boost_LIBRARY_DIRS} )
|
||||
cache_set(CGAL_3RD_PARTY_DEFINITIONS ${CGAL_3RD_PARTY_DEFINITIONS} ${Boost_DEFINITIONS} )
|
||||
add_to_list(CGAL_3RD_PARTY_INCLUDE_DIRS PERSISTENT ${Boost_INCLUDE_DIRS} )
|
||||
add_to_list(CGAL_3RD_PARTY_LIBRARIES_DIRS PERSISTENT ${Boost_LIBRARY_DIRS} )
|
||||
add_to_list(CGAL_3RD_PARTY_DEFINITIONS PERSISTENT ${Boost_DEFINITIONS} )
|
||||
|
||||
if ( NOT MSVC )
|
||||
cache_set(CGAL_3RD_PARTY_LIBRARIES ${CGAL_3RD_PARTY_LIBRARIES} ${Boost_LIBRARIES})
|
||||
add_to_persistent_tagged_libraries(CGAL_3RD_PARTY_LIBRARIES ${Boost_LIBRARIES} )
|
||||
endif()
|
||||
|
||||
message( STATUS "USING BOOST_VERSION = '${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}'" )
|
||||
|
|
|
|||
|
|
@ -10,6 +10,6 @@ endif()
|
|||
include(CGAL_SetupBoost)
|
||||
|
||||
if ( MSVC )
|
||||
cache_set(CGAL_3RD_PARTY_LIBRARIES ${CGAL_3RD_PARTY_LIBRARIES} "psapi.lib" )
|
||||
add_to_persistent_tagged_libraries(CGAL_3RD_PARTY_LIBRARIES "psapi.lib" )
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,12 @@
|
|||
# Set CGAL_DONT_OVERRIDE_CMAKE_FLAGS to TRUE if you need to prevent the CGAL configuration to
|
||||
# override the flags used to build the libraries
|
||||
#
|
||||
set( CGAL_DONT_OVERRIDE_CMAKE_FLAGS_DESCRIPTION
|
||||
"Set this to TRUE if you want to define or modify any of CMAKE_*_FLAGS. When this is FALSE, all the CMAKE_*_FLAGS flags are overriden with the values used when building the CGAL libs. For CGAL_*_flags (used for ADDITIONAL flags) , there is no need to set this to TRUE."
|
||||
)
|
||||
|
||||
option( CGAL_DONT_OVERRIDE_CMAKE_FLAGS
|
||||
"Set this to TRUE if you want to define or modify any of CMAKE_*_FLAGS. When this is FALSE, all the CMAKE_*_FLAGS flags are overriden with the values used when building the CGAL libs. For CGAL_*_flags (used for ADDITIONAL flags) , there is no need to set this to TRUE."
|
||||
${CGAL_DONT_OVERRIDE_CMAKE_FLAGS_DESCRIPTION}
|
||||
FALSE
|
||||
)
|
||||
|
||||
|
|
@ -26,6 +30,8 @@ if ( CGAL_CONFIG_LOADED AND NOT CGAL_DONT_OVERRIDE_CMAKE_FLAGS )
|
|||
|
||||
endif()
|
||||
|
||||
typed_cache_set( BOOL ${CGAL_DONT_OVERRIDE_CMAKE_FLAGS_DESCRIPTION} CGAL_DONT_OVERRIDE_CMAKE_FLAGS TRUE )
|
||||
|
||||
uniquely_add_flags( CMAKE_CXX_FLAGS ${CGAL_CXX_FLAGS} )
|
||||
uniquely_add_flags( CMAKE_CXX_FLAGS_RELEASE ${CGAL_CXX_FLAGS_RELEASE} )
|
||||
uniquely_add_flags( CMAKE_CXX_FLAGS_DEBUG ${CGAL_CXX_FLAGS_DEBUG} )
|
||||
|
|
@ -56,9 +62,6 @@ message( STATUS "Build type: ${CMAKE_BUILD_TYPE}" )
|
|||
|
||||
string( TOUPPER "${CMAKE_BUILD_TYPE}" CGAL_BUILD_TYPE_UPPER )
|
||||
|
||||
# Only one configuration type is supported
|
||||
typed_cache_set ( STRING "Build type: Release or Debug" CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE} )
|
||||
|
||||
message( STATUS "USING CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CGAL_BUILD_TYPE_UPPER}}'" )
|
||||
|
||||
if ( CGAL_BUILDING_LIBS )
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@ if ( NOT CGAL_GMP_SETUP )
|
|||
|
||||
get_dependency_version(GMP)
|
||||
|
||||
cache_set(CGAL_3RD_PARTY_INCLUDE_DIRS ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${GMP_INCLUDE_DIR} )
|
||||
cache_set(CGAL_3RD_PARTY_LIBRARIES_DIRS ${CGAL_3RD_PARTY_LIBRARIES_DIRS} ${GMP_LIBRARIES_DIR} )
|
||||
cache_set(CGAL_3RD_PARTY_DEFINITIONS ${CGAL_3RD_PARTY_DEFINITIONS} ${GMP_DEFINITIONS} )
|
||||
add_to_list(CGAL_3RD_PARTY_INCLUDE_DIRS PERSISTENT ${GMP_INCLUDE_DIR} )
|
||||
add_to_list(CGAL_3RD_PARTY_LIBRARIES_DIRS PERSISTENT ${GMP_LIBRARIES_DIR} )
|
||||
add_to_list(CGAL_3RD_PARTY_DEFINITIONS PERSISTENT ${GMP_DEFINITIONS} )
|
||||
|
||||
if ( NOT MSVC )
|
||||
cache_set(CGAL_3RD_PARTY_LIBRARIES ${CGAL_3RD_PARTY_LIBRARIES} ${GMP_LIBRARIES})
|
||||
add_to_persistent_tagged_libraries(CGAL_3RD_PARTY_LIBRARIES ${GMP_LIBRARIES} )
|
||||
endif()
|
||||
|
||||
set( CGAL_GMP_SETUP TRUE )
|
||||
|
|
|
|||
|
|
@ -15,8 +15,9 @@ if ( NOT WIN32 AND NOT CGAL_GMPXX_SETUP )
|
|||
|
||||
include(CGAL_Macros)
|
||||
|
||||
cache_set(CGAL_3RD_PARTY_INCLUDE_DIRS ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${GMPXX_INCLUDE_DIR} )
|
||||
cache_set(CGAL_3RD_PARTY_LIBRARIES ${CGAL_3RD_PARTY_LIBRARIES} ${GMPXX_LIBRARIES} )
|
||||
add_to_list(CGAL_3RD_PARTY_INCLUDE_DIRS PERSISTENT ${GMPXX_INCLUDE_DIR} )
|
||||
|
||||
add_to_persistent_tagged_libraries(CGAL_3RD_PARTY_LIBRARIES ${GMPXX_LIBRARIES} )
|
||||
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -12,9 +12,10 @@ if ( NOT CGAL_LEDA_SETUP )
|
|||
|
||||
include(CGAL_Macros)
|
||||
|
||||
cache_set(CGAL_3RD_PARTY_INCLUDE_DIRS ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${LEDA_INCLUDE_DIR} )
|
||||
cache_set(CGAL_3RD_PARTY_DEFINITIONS ${CGAL_3RD_PARTY_DEFINITIONS} ${LEDA_DEFINITIONS} )
|
||||
cache_set(CGAL_3RD_PARTY_LIBRARIES ${CGAL_3RD_PARTY_LIBRARIES} ${LEDA_LIBRARIES} )
|
||||
add_to_list(CGAL_3RD_PARTY_INCLUDE_DIRS PERSISTENT ${LEDA_INCLUDE_DIR} )
|
||||
add_to_list(CGAL_3RD_PARTY_DEFINITIONS PERSISTENT ${LEDA_DEFINITIONS} )
|
||||
|
||||
add_to_persistent_tagged_libraries(CGAL_3RD_PARTY_LIBRARIES ${LEDA_LIBRARIES} )
|
||||
|
||||
uniquely_add_flags( CMAKE_CXX_FLAGS ${LEDA_CXX_FLAGS} )
|
||||
|
||||
|
|
|
|||
|
|
@ -13,12 +13,12 @@ if ( NOT CGAL_MPFR_SETUP )
|
|||
set( MPFR_DEPENDENCY_INCLUDE_DIR ${GMP_INCLUDE_DIR} )
|
||||
get_dependency_version(MPFR)
|
||||
|
||||
cache_set(CGAL_3RD_PARTY_INCLUDE_DIRS ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${MPFR_INCLUDE_DIR} )
|
||||
cache_set(CGAL_3RD_PARTY_LIBRARIES_DIRS ${CGAL_3RD_PARTY_LIBRARIES_DIRS} ${MPFR_LIBRARIES_DIR} )
|
||||
cache_set(CGAL_3RD_PARTY_DEFINITIONS ${CGAL_3RD_PARTY_DEFINITIONS} ${MPFR_DEFINITIONS} )
|
||||
add_to_list(CGAL_3RD_PARTY_INCLUDE_DIRS PERSISTENT ${MPFR_INCLUDE_DIR} )
|
||||
add_to_list(CGAL_3RD_PARTY_LIBRARIES_DIRS PERSISTENT ${MPFR_LIBRARIES_DIR} )
|
||||
add_to_list(CGAL_3RD_PARTY_DEFINITIONS PERSISTENT ${MPFR_DEFINITIONS} )
|
||||
|
||||
if ( NOT MSVC )
|
||||
cache_set(CGAL_3RD_PARTY_LIBRARIES ${CGAL_3RD_PARTY_LIBRARIES} ${MPFR_LIBRARIES})
|
||||
add_to_persistent_tagged_libraries(CGAL_3RD_PARTY_LIBRARIES ${MPFR_LIBRARIES} )
|
||||
endif()
|
||||
|
||||
set( CGAL_MPFR_SETUP TRUE )
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ if (GMP_INCLUDE_DIR AND GMP_LIBRARIES_DIR )
|
|||
|
||||
else()
|
||||
|
||||
# Look first for the GMP distributed with CGAL in auxiliary/gmp
|
||||
find_path(GMP_INCLUDE_DIR
|
||||
NAMES gmp.h
|
||||
PATHS ${CMAKE_SOURCE_DIR}/auxiliary/gmp/include
|
||||
|
|
|
|||
|
|
@ -24,24 +24,6 @@ else()
|
|||
typed_cache_set( FILEPATH "The directory containing the LEDA header files WITHOUT the LEDA prefix" LEDA_INCLUDE_DIR "$ENV{LEDA_INC_DIR}" )
|
||||
endif()
|
||||
|
||||
if ( NOT LEDA_LIBRARY_RELEASE )
|
||||
typed_cache_set( FILEPATH "The LEDA release-mode libraries" LEDA_LIBRARY_RELEASE "$ENV{LEDA_LIBRARY_RELEASE}" )
|
||||
endif()
|
||||
|
||||
if ( NOT LEDA_LIBRARY_DEBUG )
|
||||
typed_cache_set( FILEPATH "The LEDA debug-mode libraries" LEDA_LIBRARY_DEBUG "$ENV{LEDA_LIBRARY_DEBUG}" )
|
||||
endif()
|
||||
|
||||
if ( "${CMAKE_BUILD_TYPE}" STREQUAL "Release" )
|
||||
if ( LEDA_LIBRARY_RELEASE )
|
||||
set( LEDA_LIBRARIES "${LEDA_LIBRARY_RELEASE}" )
|
||||
endif()
|
||||
else()
|
||||
if ( LEDA_LIBRARY_DEBUG )
|
||||
set( LEDA_LIBRARIES "${LEDA_LIBRARY_DEBUG}" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if ( NOT LEDA_DEFINITIONS )
|
||||
typed_cache_set( STRING "Definitions for the LEDA library" LEDA_DEFINITIONS "$ENV{LEDA_DEFINITIONS}" )
|
||||
endif()
|
||||
|
|
@ -54,6 +36,17 @@ else()
|
|||
typed_cache_set( STRING "Linker flags for the LEDA library" LEDA_LINKER_FLAGS "$ENV{LEDA_LINKER_FLAGS}" )
|
||||
endif()
|
||||
|
||||
if ( NOT LEDA_LIBRARY_RELEASE )
|
||||
typed_cache_set( FILEPATH "The LEDA release-mode libraries" LEDA_LIBRARY_RELEASE "$ENV{LEDA_LIBRARY_RELEASE}" )
|
||||
endif()
|
||||
|
||||
if ( NOT LEDA_LIBRARY_DEBUG )
|
||||
typed_cache_set( FILEPATH "The LEDA debug-mode libraries" LEDA_LIBRARY_DEBUG "$ENV{LEDA_LIBRARY_DEBUG}" )
|
||||
endif()
|
||||
|
||||
set(LEDA_LIBRARIES)
|
||||
tag_libraries( LEDA_LIBRARY_RELEASE LEDA_LIBRARY_DEBUG LEDA_LIBRARIES )
|
||||
|
||||
endif()
|
||||
|
||||
set( LEDA_BASIC_H "${LEDA_INCLUDE_DIR}/LEDA/system/basic.h" )
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ if (MPFR_INCLUDE_DIR AND MPFR_LIBRARIES_DIR )
|
|||
|
||||
else()
|
||||
|
||||
# Look first for the MPFR distributed with CGAL in auxiliary/mpfr
|
||||
find_path(MPFR_INCLUDE_DIR
|
||||
NAMES mpfr.h
|
||||
PATHS ${CMAKE_SOURCE_DIR}/auxiliary/gmp/include
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
# QGLVIEWER_DEFINITIONS - Compiler switches required for using QGLViewer
|
||||
#
|
||||
|
||||
|
||||
find_path(QGLVIEWER_INCLUDE_DIR
|
||||
NAMES QGLViewer/qglviewer.h
|
||||
PATHS /usr/include
|
||||
|
|
@ -15,9 +14,7 @@ find_path(QGLVIEWER_INCLUDE_DIR
|
|||
ENV QGLVIEWERROOT
|
||||
)
|
||||
|
||||
#set( BUILD_SHARED_LIBS ON )
|
||||
|
||||
FIND_LIBRARY(QGLVIEWER_LIBRARY_RELEASE
|
||||
find_library(QGLVIEWER_LIBRARY_RELEASE
|
||||
NAMES QGLViewer QGLViewer2
|
||||
PATHS /usr/lib
|
||||
/usr/local/lib
|
||||
|
|
@ -27,7 +24,7 @@ FIND_LIBRARY(QGLVIEWER_LIBRARY_RELEASE
|
|||
PATH_SUFFIXES QGLViewer QGLViewer/release
|
||||
)
|
||||
|
||||
FIND_LIBRARY(QGLVIEWER_LIBRARY_DEBUG
|
||||
find_library(QGLVIEWER_LIBRARY_DEBUG
|
||||
NAMES dQGLViewer dQGLViewer2
|
||||
PATHS /usr/lib
|
||||
/usr/local/lib
|
||||
|
|
@ -37,23 +34,10 @@ FIND_LIBRARY(QGLVIEWER_LIBRARY_DEBUG
|
|||
PATH_SUFFIXES QGLViewer QGLViewer/debug
|
||||
)
|
||||
|
||||
IF (QGLVIEWER_LIBRARY_RELEASE AND NOT QGLVIEWER_LIBRARY_DEBUG)
|
||||
SET(QGLVIEWER_LIBRARY_DEBUG ${QGLVIEWER_LIBRARY_RELEASE})
|
||||
ENDIF (QGLVIEWER_LIBRARY_RELEASE AND NOT QGLVIEWER_LIBRARY_DEBUG)
|
||||
set(QGLVIEWER_LIBRARIES)
|
||||
tag_libraries( QGLVIEWER_LIBRARY_RELEASE QGLVIEWER_LIBRARY_DEBUG QGLVIEWER_LIBRARIES )
|
||||
|
||||
IF (QGLVIEWER_LIBRARY_DEBUG AND NOT QGLVIEWER_LIBRARY_RELEASE)
|
||||
SET(QGLVIEWER_LIBRARY_RELEASE ${QGLVIEWER_LIBRARY_DEBUG})
|
||||
ENDIF (QGLVIEWER_LIBRARY_DEBUG AND NOT QGLVIEWER_LIBRARY_RELEASE)
|
||||
|
||||
IF (QGLVIEWER_LIBRARY_DEBUG AND QGLVIEWER_LIBRARY_RELEASE)
|
||||
IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
|
||||
SET(QGLVIEWER_LIBRARY optimized ${QGLVIEWER_LIBRARY_RELEASE} debug ${QGLVIEWER_LIBRARY_DEBUG})
|
||||
ELSE (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
|
||||
SET(QGLVIEWER_LIBRARY ${QGLVIEWER_LIBRARY_RELEASE})
|
||||
ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
|
||||
|
||||
SET(QGLVIEWER_LIBRARY ${QGLVIEWER_LIBRARY} CACHE FILEPATH "The QGLViewer library")
|
||||
ENDIF(QGLVIEWER_LIBRARY_DEBUG AND QGLVIEWER_LIBRARY_RELEASE)
|
||||
set(QGLVIEWER_LIBRARY ${QGLVIEWER_LIBRARIES} CACHE FILEPATH "The QGLViewer library")
|
||||
|
||||
IF(QGLVIEWER_INCLUDE_DIR AND QGLVIEWER_LIBRARY)
|
||||
SET(QGLVIEWER_FOUND TRUE)
|
||||
|
|
|
|||
|
|
@ -20,19 +20,20 @@ if(NOT USE_CGAL_FILE_INCLUDED)
|
|||
include(CGAL_GeneratorSpecificSettings)
|
||||
endif()
|
||||
|
||||
set( CGAL_LIBRARIES "" )
|
||||
|
||||
set( CGAL_LIBRARIES )
|
||||
|
||||
foreach ( CGAL_COMPONENT ${CGAL_FIND_COMPONENTS} )
|
||||
|
||||
set( CGAL_LIBRARIES ${CGAL_LIBRARIES} ${CGAL_${CGAL_COMPONENT}_LIBRARY} )
|
||||
set( CGAL_3RD_PARTY_INCLUDE_DIRS ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_INCLUDE_DIRS} )
|
||||
set( CGAL_3RD_PARTY_DEFINITIONS ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_DEFINITIONS} )
|
||||
set( CGAL_3RD_PARTY_LIBRARIES_DIRS ${CGAL_3RD_PARTY_LIBRARIES_DIRS} ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_LIBRARIES_DIRS} )
|
||||
set( CGAL_3RD_PARTY_LIBRARIES ${CGAL_3RD_PARTY_LIBRARIES} ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_LIBRARIES} )
|
||||
add_to_in_memory_tagged_libraries( CGAL_LIBRARIES ${CGAL_${CGAL_COMPONENT}_LIBRARY} )
|
||||
add_to_in_memory_tagged_libraries( CGAL_3RD_PARTY_LIBRARIES ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_LIBRARIES} )
|
||||
|
||||
add_to_list( CGAL_3RD_PARTY_INCLUDE_DIRS ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_INCLUDE_DIRS} )
|
||||
add_to_list( CGAL_3RD_PARTY_DEFINITIONS ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_DEFINITIONS} )
|
||||
add_to_list( CGAL_3RD_PARTY_LIBRARIES_DIRS ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_LIBRARIES_DIRS} )
|
||||
|
||||
endforeach()
|
||||
|
||||
set( CGAL_LIBRARIES ${CGAL_LIBRARIES} ${CGAL_LIBRARY} )
|
||||
add_to_in_memory_tagged_libraries( CGAL_LIBRARIES ${CGAL_LIBRARY} )
|
||||
|
||||
include_directories ( ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${CGAL_INCLUDE_DIRS} )
|
||||
add_definitions ( ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_DEFINITIONS} )
|
||||
|
|
|
|||
Loading…
Reference in New Issue