diff options
Diffstat (limited to 'config/cmake/HDFMacros.cmake')
-rw-r--r-- | config/cmake/HDFMacros.cmake | 140 |
1 files changed, 70 insertions, 70 deletions
diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake index b0788f2..56fdf83 100644 --- a/config/cmake/HDFMacros.cmake +++ b/config/cmake/HDFMacros.cmake @@ -1,52 +1,52 @@ #------------------------------------------------------------------------------- MACRO (SET_GLOBAL_VARIABLE name value) - SET (${name} ${value} CACHE INTERNAL "Used to pass variables between directories" FORCE) + set (${name} ${value} CACHE INTERNAL "Used to pass variables between directories" FORCE) ENDMACRO (SET_GLOBAL_VARIABLE) #------------------------------------------------------------------------------- MACRO (IDE_GENERATED_PROPERTIES SOURCE_PATH HEADERS SOURCES) #set(source_group_path "Source/AIM/${NAME}") - STRING (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH}) + string (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH}) source_group (${source_group_path} FILES ${HEADERS} ${SOURCES}) #-- The following is needed if we ever start to use OS X Frameworks but only #-- works on CMake 2.6 and greater - #SET_PROPERTY (SOURCE ${HEADERS} + #set_property (SOURCE ${HEADERS} # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} #) ENDMACRO (IDE_GENERATED_PROPERTIES) #------------------------------------------------------------------------------- MACRO (IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES) - # INSTALL (FILES ${HEADERS} + # install (FILES ${HEADERS} # DESTINATION include/R3D/${NAME} # COMPONENT Headers # ) - STRING (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH} ) + string (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH} ) source_group (${source_group_path} FILES ${HEADERS} ${SOURCES}) #-- The following is needed if we ever start to use OS X Frameworks but only #-- works on CMake 2.6 and greater - #SET_PROPERTY (SOURCE ${HEADERS} + #set_property (SOURCE ${HEADERS} # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} #) ENDMACRO (IDE_SOURCE_PROPERTIES) #------------------------------------------------------------------------------- MACRO (TARGET_NAMING libtarget libtype) - IF (WIN32) - IF (${libtype} MATCHES "SHARED") - SET_TARGET_PROPERTIES (${libtarget} PROPERTIES OUTPUT_NAME "${libtarget}dll") - ENDIF (${libtype} MATCHES "SHARED") - ENDIF (WIN32) + if (WIN32) + if (${libtype} MATCHES "SHARED") + set_target_properties (${libtarget} PROPERTIES OUTPUT_NAME "${libtarget}dll") + endif (${libtype} MATCHES "SHARED") + endif (WIN32) ENDMACRO (TARGET_NAMING) #------------------------------------------------------------------------------- MACRO (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent) - IF (WIN32 AND MSVC) - GET_TARGET_PROPERTY (target_name ${libtarget} RELWITHDEBINFO_OUTPUT_NAME) - INSTALL ( + if (WIN32 AND MSVC) + get_target_property (target_name ${libtarget} RELWITHDEBINFO_OUTPUT_NAME) + install ( FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${target_name}.pdb DESTINATION @@ -54,15 +54,15 @@ MACRO (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent) CONFIGURATIONS RelWithDebInfo COMPONENT ${targetcomponent} ) - ENDIF (WIN32 AND MSVC) + endif (WIN32 AND MSVC) ENDMACRO (INSTALL_TARGET_PDB) #------------------------------------------------------------------------------- MACRO (INSTALL_PROGRAM_PDB progtarget targetdestination targetcomponent) - IF (WIN32 AND MSVC) - GET_TARGET_PROPERTY (target_name ${progtarget} RELWITHDEBINFO_OUTPUT_NAME) - GET_TARGET_PROPERTY (target_prefix ${progtarget} PREFIX) - INSTALL ( + if (WIN32 AND MSVC) + get_target_property (target_name ${progtarget} RELWITHDEBINFO_OUTPUT_NAME) + get_target_property (target_prefix ${progtarget} PREFIX) + install ( FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${target_prefix}${target_name}.pdb DESTINATION @@ -70,37 +70,37 @@ MACRO (INSTALL_PROGRAM_PDB progtarget targetdestination targetcomponent) CONFIGURATIONS RelWithDebInfo COMPONENT ${targetcomponent} ) - ENDIF (WIN32 AND MSVC) + endif (WIN32 AND MSVC) ENDMACRO (INSTALL_PROGRAM_PDB) #------------------------------------------------------------------------------- MACRO (HDF_SET_LIB_OPTIONS libtarget libname libtype) # message (STATUS "${libname} libtype: ${libtype}") - IF (${libtype} MATCHES "SHARED") - IF (WIN32) - SET (LIB_RELEASE_NAME "${libname}") - SET (LIB_DEBUG_NAME "${libname}_D") - ELSE (WIN32) - SET (LIB_RELEASE_NAME "${libname}") - SET (LIB_DEBUG_NAME "${libname}_debug") - ENDIF (WIN32) - ELSE (${libtype} MATCHES "SHARED") - IF (WIN32) - SET (LIB_RELEASE_NAME "lib${libname}") - SET (LIB_DEBUG_NAME "lib${libname}_D") - ELSE (WIN32) + if (${libtype} MATCHES "SHARED") + if (WIN32) + set (LIB_RELEASE_NAME "${libname}") + set (LIB_DEBUG_NAME "${libname}_D") + else (WIN32) + set (LIB_RELEASE_NAME "${libname}") + set (LIB_DEBUG_NAME "${libname}_debug") + endif (WIN32) + else (${libtype} MATCHES "SHARED") + if (WIN32) + set (LIB_RELEASE_NAME "lib${libname}") + set (LIB_DEBUG_NAME "lib${libname}_D") + else (WIN32) # if the generator supports configuration types or if the CMAKE_BUILD_TYPE has a value - IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET (LIB_RELEASE_NAME "${libname}") - SET (LIB_DEBUG_NAME "${libname}_debug") - ELSE (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET (LIB_RELEASE_NAME "lib${libname}") - SET (LIB_DEBUG_NAME "lib${libname}_debug") - ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - ENDIF (WIN32) - ENDIF (${libtype} MATCHES "SHARED") + if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + set (LIB_RELEASE_NAME "${libname}") + set (LIB_DEBUG_NAME "${libname}_debug") + else (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + set (LIB_RELEASE_NAME "lib${libname}") + set (LIB_DEBUG_NAME "lib${libname}_debug") + endif (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + endif (WIN32) + endif (${libtype} MATCHES "SHARED") - SET_TARGET_PROPERTIES (${libtarget} + set_target_properties (${libtarget} PROPERTIES DEBUG_OUTPUT_NAME ${LIB_DEBUG_NAME} RELEASE_OUTPUT_NAME ${LIB_RELEASE_NAME} @@ -109,79 +109,79 @@ MACRO (HDF_SET_LIB_OPTIONS libtarget libname libtype) ) #----- Use MSVC Naming conventions for Shared Libraries - IF (MINGW AND ${libtype} MATCHES "SHARED") - SET_TARGET_PROPERTIES (${libtarget} + if (MINGW AND ${libtype} MATCHES "SHARED") + set_target_properties (${libtarget} PROPERTIES IMPORT_SUFFIX ".lib" IMPORT_PREFIX "" PREFIX "" ) - ENDIF (MINGW AND ${libtype} MATCHES "SHARED") + endif (MINGW AND ${libtype} MATCHES "SHARED") ENDMACRO (HDF_SET_LIB_OPTIONS) #------------------------------------------------------------------------------- MACRO (TARGET_C_PROPERTIES wintarget addcompileflags addlinkflags) - IF (MSVC) + if (MSVC) TARGET_MSVC_PROPERTIES (${wintarget} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") - ELSE (MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${wintarget} + else (MSVC) + if (BUILD_SHARED_LIBS) + set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}" ) - ELSE (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${wintarget} + else (BUILD_SHARED_LIBS) + set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}" ) - ENDIF (BUILD_SHARED_LIBS) - ENDIF (MSVC) + endif (BUILD_SHARED_LIBS) + endif (MSVC) ENDMACRO (TARGET_C_PROPERTIES) #------------------------------------------------------------------------------- MACRO (TARGET_MSVC_PROPERTIES wintarget addcompileflags addlinkflags) - IF (MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${wintarget} + if (MSVC) + if (BUILD_SHARED_LIBS) + set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}" ) - ELSE (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${wintarget} + else (BUILD_SHARED_LIBS) + set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}" ) - ENDIF (BUILD_SHARED_LIBS) - ENDIF (MSVC) + endif (BUILD_SHARED_LIBS) + endif (MSVC) ENDMACRO (TARGET_MSVC_PROPERTIES) #------------------------------------------------------------------------------- MACRO (TARGET_FORTRAN_PROPERTIES forttarget addcompileflags addlinkflags) - IF (WIN32) + if (WIN32) TARGET_FORTRAN_WIN_PROPERTIES (${forttarget} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") - ENDIF (WIN32) + endif (WIN32) ENDMACRO (TARGET_FORTRAN_PROPERTIES) #------------------------------------------------------------------------------- MACRO (TARGET_FORTRAN_WIN_PROPERTIES forttarget addcompileflags addlinkflags) - IF (MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${forttarget} + if (MSVC) + if (BUILD_SHARED_LIBS) + set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "/dll ${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" ) - ELSE (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${forttarget} + else (BUILD_SHARED_LIBS) + set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" ) - ENDIF (BUILD_SHARED_LIBS) - ENDIF (MSVC) + endif (BUILD_SHARED_LIBS) + endif (MSVC) ENDMACRO (TARGET_FORTRAN_WIN_PROPERTIES) |