parent
4a0599115c
commit
2f5181c101
@ -0,0 +1,10 @@
|
|||||||
|
# support for the MS assembler, masm and masm64
|
||||||
|
|
||||||
|
SET(ASM_DIALECT "_MASM")
|
||||||
|
|
||||||
|
SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm)
|
||||||
|
|
||||||
|
SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> /c /Fo <OBJECT> <SOURCE>")
|
||||||
|
|
||||||
|
INCLUDE(CMakeASMInformation)
|
||||||
|
SET(ASM_DIALECT)
|
@ -0,0 +1,13 @@
|
|||||||
|
# Find the MS assembler (masm or masm64)
|
||||||
|
|
||||||
|
SET(ASM_DIALECT "_MASM")
|
||||||
|
|
||||||
|
# if we are using the 64bit cl compiler, assume we also want the 64bit assembler
|
||||||
|
IF(CMAKE_CL_64)
|
||||||
|
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml64)
|
||||||
|
ELSE(CMAKE_CL_64)
|
||||||
|
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml)
|
||||||
|
ENDIF(CMAKE_CL_64)
|
||||||
|
|
||||||
|
INCLUDE(CMakeDetermineASMCompiler)
|
||||||
|
SET(ASM_DIALECT)
|
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# This file is used by EnableLanguage in cmGlobalGenerator to
|
||||||
|
# determine that the selected ASM_MASM "compiler" (should be masm or masm64)
|
||||||
|
# can actually "compile" and link the most basic of programs. If not, a
|
||||||
|
# fatal error is set and cmake stops processing commands and will not generate
|
||||||
|
# any makefiles or projects.
|
||||||
|
|
||||||
|
SET(ASM_DIALECT "_MASM")
|
||||||
|
INCLUDE(CMakeTestASMCompiler)
|
||||||
|
SET(ASM_DIALECT)
|
@ -0,0 +1,72 @@
|
|||||||
|
# - Find Coin3D (Open Inventor)
|
||||||
|
# Coin3D is an implementation of the Open Inventor API.
|
||||||
|
# It provides data structures and algorithms for 3D visualization
|
||||||
|
# http://www.coin3d.org/
|
||||||
|
#
|
||||||
|
# This module defines the following variables
|
||||||
|
# COIN3D_FOUND - system has Coin3D - Open Inventor
|
||||||
|
# COIN3D_INCLUDE_DIRS - where the Inventor include directory can be found
|
||||||
|
# COIN3D_LIBRARIES - Link to this to use Coin3D
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
IF (WIN32)
|
||||||
|
IF (CYGWIN)
|
||||||
|
|
||||||
|
FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h)
|
||||||
|
FIND_LIBRARY(COIN3D_LIBRARIES Coin)
|
||||||
|
|
||||||
|
ELSE (CYGWIN)
|
||||||
|
|
||||||
|
FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h
|
||||||
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/include"
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(COIN3D_LIBRARY_DEBUG coin2d
|
||||||
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/lib"
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(COIN3D_LIBRARY_RELEASE coin2
|
||||||
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/lib"
|
||||||
|
)
|
||||||
|
|
||||||
|
IF (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
|
||||||
|
SET(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
|
||||||
|
debug ${COIN3D_LIBRARY_DEBUG})
|
||||||
|
ELSE (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
|
||||||
|
IF (COIN3D_LIBRARY_DEBUG)
|
||||||
|
SET (COIN3D_LIBRARIES ${COIN3D_LIBRARY_DEBUG})
|
||||||
|
ENDIF (COIN3D_LIBRARY_DEBUG)
|
||||||
|
IF (COIN3D_LIBRARY_RELEASE)
|
||||||
|
SET (COIN3D_LIBRARIES ${COIN3D_LIBRARY_RELEASE})
|
||||||
|
ENDIF (COIN3D_LIBRARY_RELEASE)
|
||||||
|
ENDIF (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
|
||||||
|
|
||||||
|
ENDIF (CYGWIN)
|
||||||
|
|
||||||
|
ELSE (WIN32)
|
||||||
|
IF(APPLE)
|
||||||
|
FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h
|
||||||
|
/Library/Frameworks/Inventor.framework/Headers
|
||||||
|
)
|
||||||
|
FIND_LIBRARY(COIN3D_LIBRARIES Coin
|
||||||
|
/Library/Frameworks/Inventor.framework/Libraries
|
||||||
|
)
|
||||||
|
SET(COIN3D_LIBRARIES "-framework Coin3d" CACHE STRING "Coin3D library for OSX")
|
||||||
|
ELSE(APPLE)
|
||||||
|
|
||||||
|
FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h)
|
||||||
|
FIND_LIBRARY(COIN3D_LIBRARIES Coin)
|
||||||
|
|
||||||
|
ENDIF(APPLE)
|
||||||
|
|
||||||
|
ENDIF (WIN32)
|
||||||
|
|
||||||
|
# handle the QUIETLY and REQUIRED arguments and set COIN3D_FOUND to TRUE if
|
||||||
|
# all listed variables are TRUE
|
||||||
|
INCLUDE(FindPackageHandleStandardArgs)
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Coin3D DEFAULT_MSG COIN3D_LIBRARIES COIN3D_INCLUDE_DIRS)
|
||||||
|
|
||||||
|
MARK_AS_ADVANCED(COIN3D_INCLUDE_DIRS COIN3D_LIBRARIES )
|
||||||
|
|
||||||
|
|
@ -0,0 +1,113 @@
|
|||||||
|
# - Find CxxTest
|
||||||
|
# Find the CxxTest suite and declare a helper macro for creating unit tests
|
||||||
|
# and integrating them with CTest.
|
||||||
|
# For more details on CxxTest see http://cxxtest.tigris.org
|
||||||
|
#
|
||||||
|
# INPUT Variables
|
||||||
|
#
|
||||||
|
# CXXTEST_USE_PYTHON
|
||||||
|
# If true, the CXXTEST_ADD_TEST macro will use
|
||||||
|
# the Python test generator instead of Perl.
|
||||||
|
#
|
||||||
|
# OUTPUT Variables
|
||||||
|
#
|
||||||
|
# CXXTEST_FOUND
|
||||||
|
# True if the CxxTest framework was found
|
||||||
|
# CXXTEST_INCLUDE_DIR
|
||||||
|
# Where to find the CxxTest include directory
|
||||||
|
# CXXTEST_PERL_TESTGEN_EXECUTABLE
|
||||||
|
# The perl-based test generator.
|
||||||
|
# CXXTEST_PYTHON_TESTGEN_EXECUTABLE
|
||||||
|
# The python-based test generator.
|
||||||
|
#
|
||||||
|
# MACROS for use by CMake users:
|
||||||
|
#
|
||||||
|
# CXXTEST_ADD_TEST(<test_name> <gen_source_file> <input_files_to_testgen...>)
|
||||||
|
# Creates a CxxTest runner and adds it to the CTest testing suite
|
||||||
|
# Parameters:
|
||||||
|
# test_name The name of the test
|
||||||
|
# gen_source_file The generated source filename to be generated by CxxTest
|
||||||
|
# input_files_to_testgen The list of header files containing the
|
||||||
|
# CxxTest::TestSuite's to be included in this runner
|
||||||
|
#
|
||||||
|
# #==============
|
||||||
|
# Example Usage:
|
||||||
|
#
|
||||||
|
# FIND_PACKAGE(CxxTest)
|
||||||
|
# INCLUDE_DIRECTORIES(${CXXTEST_INCLUDE_DIR})
|
||||||
|
#
|
||||||
|
# ENABLE_TESTING()
|
||||||
|
# CXXTEST_ADD_TEST(unittest_foo foo_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/foo_test.h)
|
||||||
|
#
|
||||||
|
# This will:
|
||||||
|
# 1. Invoke the testgen executable to autogenerate foo_test.cc in the
|
||||||
|
# binary tree from "foo_test.h" in the current source directory.
|
||||||
|
# 2. Create an executable and test called unittest_foo.
|
||||||
|
#
|
||||||
|
# #=============
|
||||||
|
# Example foo_test.h:
|
||||||
|
#
|
||||||
|
# #include <cxxtest/TestSuite.h>
|
||||||
|
#
|
||||||
|
# class MyTestSuite : public CxxTest::TestSuite
|
||||||
|
# {
|
||||||
|
# public:
|
||||||
|
# void testAddition( void )
|
||||||
|
# {
|
||||||
|
# TS_ASSERT( 1 + 1 > 1 );
|
||||||
|
# TS_ASSERT_EQUALS( 1 + 1, 2 );
|
||||||
|
# }
|
||||||
|
# };
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# FindCxxTest.cmake
|
||||||
|
# Copyright (c) 2008
|
||||||
|
# Philip Lowman <philip@yhbt.com>
|
||||||
|
#
|
||||||
|
# Version 1.0 (1/8/08)
|
||||||
|
# Fixed CXXTEST_INCLUDE_DIRS so it will work properly
|
||||||
|
# Eliminated superfluous CXXTEST_FOUND assignment
|
||||||
|
# Cleaned up and added more documentation
|
||||||
|
|
||||||
|
#=============================================================
|
||||||
|
# CXXTEST_ADD_TEST (public macro)
|
||||||
|
#=============================================================
|
||||||
|
MACRO(CXXTEST_ADD_TEST _cxxtest_testname _cxxtest_outfname)
|
||||||
|
SET(_cxxtest_real_outfname ${CMAKE_CURRENT_BINARY_DIR}/${_cxxtest_outfname})
|
||||||
|
IF(CXXTEST_USE_PYTHON)
|
||||||
|
SET(_cxxtest_executable ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE})
|
||||||
|
ELSE()
|
||||||
|
SET(_cxxtest_executable ${CXXTEST_PERL_TESTGEN_EXECUTABLE})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
OUTPUT ${_cxxtest_real_outfname}
|
||||||
|
DEPENDS ${ARGN}
|
||||||
|
COMMAND ${_cxxtest_executable}
|
||||||
|
--error-printer -o ${_cxxtest_real_outfname} ${ARGN}
|
||||||
|
)
|
||||||
|
|
||||||
|
SET_SOURCE_FILES_PROPERTIES(${_cxxtest_real_outfname} PROPERTIES GENERATED true)
|
||||||
|
ADD_EXECUTABLE(${_cxxtest_testname} ${_cxxtest_real_outfname})
|
||||||
|
|
||||||
|
IF(CMAKE_RUNTIME_OUTPUT_DIRECTORY)
|
||||||
|
ADD_TEST(${_cxxtest_testname} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_cxxtest_testname})
|
||||||
|
ELSEIF(EXECUTABLE_OUTPUT_PATH)
|
||||||
|
ADD_TEST(${_cxxtest_testname} ${EXECUTABLE_OUTPUT_PATH}/${_cxxtest_testname})
|
||||||
|
ELSE()
|
||||||
|
ADD_TEST(${_cxxtest_testname} ${CMAKE_CURRENT_BINARY_DIR}/${_cxxtest_testname})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
ENDMACRO(CXXTEST_ADD_TEST)
|
||||||
|
|
||||||
|
#=============================================================
|
||||||
|
# main()
|
||||||
|
#=============================================================
|
||||||
|
|
||||||
|
FIND_PATH(CXXTEST_INCLUDE_DIR cxxtest/TestSuite.h)
|
||||||
|
FIND_PROGRAM(CXXTEST_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl)
|
||||||
|
FIND_PROGRAM(CXXTEST_PYTHON_TESTGEN_EXECUTABLE cxxtestgen.py)
|
||||||
|
|
||||||
|
INCLUDE(FindPackageHandleStandardArgs)
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CxxTest DEFAULT_MSG CXXTEST_INCLUDE_DIR)
|
||||||
|
SET(CXXTEST_INCLUDE_DIRS ${CXXTEST_INCLUDE_DIR})
|
@ -0,0 +1,50 @@
|
|||||||
|
# This module locates the developer's image library.
|
||||||
|
# http://openil.sourceforge.net/
|
||||||
|
#
|
||||||
|
# This module sets:
|
||||||
|
# IL_LIBRARY the name of the IL library.
|
||||||
|
# ILU_LIBRARY the name of the ILU library.
|
||||||
|
# ILUT_LIBRARY the name of the ILUT library.
|
||||||
|
# IL_INCLUDE_DIR where to find the il.h, ilu.h and ilut.h files.
|
||||||
|
# IL_FOUND this is set to TRUE if all the above variables were set.
|
||||||
|
|
||||||
|
# Original file by: Christopher Harvey
|
||||||
|
# TODO: Add version support.
|
||||||
|
# Tested under Linux and Windows (MSVC)
|
||||||
|
|
||||||
|
INCLUDE(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
|
FIND_PATH(IL_INCLUDE_DIR il.h
|
||||||
|
PATH_SUFFIXES include IL
|
||||||
|
DOC "The path the the directory that contains il.h"
|
||||||
|
)
|
||||||
|
|
||||||
|
#MESSAGE("IL_INCLUDE_DIR is ${IL_INCLUDE_DIR}")
|
||||||
|
|
||||||
|
FIND_LIBRARY(IL_LIBRARY
|
||||||
|
NAMES IL
|
||||||
|
PATH_SUFFIXES lib64 lib lib32
|
||||||
|
DOC "The file that corresponds to the base il library."
|
||||||
|
)
|
||||||
|
|
||||||
|
#MESSAGE("IL_LIBRARY is ${IL_LIBRARY}")
|
||||||
|
|
||||||
|
FIND_LIBRARY(ILUT_LIBRARY
|
||||||
|
NAMES ILUT
|
||||||
|
PATH_SUFFIXES lib64 lib lib32
|
||||||
|
DOC "The file that corresponds to the il (system?) utility library."
|
||||||
|
)
|
||||||
|
|
||||||
|
#MESSAGE("ILUT_LIBRARY is ${ILUT_LIBRARY}")
|
||||||
|
|
||||||
|
FIND_LIBRARY(ILU_LIBRARY
|
||||||
|
NAMES ILU
|
||||||
|
PATH_SUFFIXES lib64 lib lib32
|
||||||
|
DOC "The file that corresponds to the il utility library."
|
||||||
|
)
|
||||||
|
|
||||||
|
#MESSAGE("ILU_LIBRARY is ${ILU_LIBRARY}")
|
||||||
|
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(IL DEFAULT_MSG
|
||||||
|
IL_LIBRARY ILU_LIBRARY
|
||||||
|
ILUT_LIBRARY IL_INCLUDE_DIR)
|
@ -1,102 +1,126 @@
|
|||||||
# - This module looks for Doxygen and the path to Graphviz's dot
|
# - This module looks for Doxygen and the path to Graphviz's dot
|
||||||
# Doxygen is a documentation generation tool see http://www.doxygen.org
|
# Doxygen is a documentation generation tool. Please see
|
||||||
# With the OS X GUI version, it likes to be installed to /Applications and
|
# http://www.doxygen.org
|
||||||
# it contains the doxygen executable in the bundle. In the versions I've
|
#
|
||||||
# seen, it is located in Resources, but in general, more often binaries are
|
# This module accepts the following optional variables:
|
||||||
# located in MacOS. This code sets the following variables:
|
#
|
||||||
# DOXYGEN_EXECUTABLE = The path to the doxygen command.
|
# DOXYGEN_SKIP_DOT = If true this module will skip trying to find Dot
|
||||||
# DOXYGEN_DOT_EXECUTABLE = The path to the dot program used by doxygen.
|
# (an optional component often used by Doxygen)
|
||||||
# DOXYGEN_DOT_PATH = The path to dot not including the executable
|
#
|
||||||
# DOXYGEN = same as DOXYGEN_EXECUTABLE for backwards compatibility
|
# This modules defines the following variables:
|
||||||
# DOT = same as DOXYGEN_DOT_EXECUTABLE for backwards compatibility
|
#
|
||||||
|
# DOXYGEN_EXECUTABLE = The path to the doxygen command.
|
||||||
|
# DOXYGEN_FOUND = Was Doxygen found or not?
|
||||||
|
#
|
||||||
|
# DOXYGEN_DOT_EXECUTABLE = The path to the dot program used by doxygen.
|
||||||
|
# DOXYGEN_DOT_FOUND = Was Dot found or not?
|
||||||
|
# DOXYGEN_DOT_PATH = The path to dot not including the executable
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
# The official Doxygen.app that is distributed for OS X uses non-standard
|
|
||||||
# conventions. Instead of the command-line "doxygen" tool being placed in
|
|
||||||
# Doxygen.app/Contents/MacOS, "Doxywizard" is placed there instead and
|
|
||||||
# "doxygen" is actually placed in Contents/Resources. This is most likely
|
|
||||||
# to accomodate people who double-click on the Doxygen.app package and expect
|
|
||||||
# to see something happen. However, the CMake backend gets horribly confused
|
|
||||||
# by this. Once CMake sees the bundle, it indiscrimately uses Doxywizard
|
|
||||||
# as the executable to use. The only work-around I have found is to disable
|
|
||||||
# the app-bundle feature for only this command.
|
|
||||||
# Save the old setting
|
|
||||||
SET(TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE ${CMAKE_FIND_APPBUNDLE})
|
|
||||||
# Disable the App-bundle detection feature
|
|
||||||
SET(CMAKE_FIND_APPBUNDLE "NEVER")
|
|
||||||
# For backwards compatibility support
|
# For backwards compatibility support
|
||||||
# DOXYGEN_FIND_QUIETLY, but it should have been
|
|
||||||
# Doxygen_FIND_QUIETLY.
|
|
||||||
IF(Doxygen_FIND_QUIETLY)
|
IF(Doxygen_FIND_QUIETLY)
|
||||||
SET(DOXYGEN_FIND_QUIETLY TRUE)
|
SET(DOXYGEN_FIND_QUIETLY TRUE)
|
||||||
ENDIF(Doxygen_FIND_QUIETLY)
|
ENDIF(Doxygen_FIND_QUIETLY)
|
||||||
|
|
||||||
IF (NOT DOXYGEN_FIND_QUIETLY)
|
# ===== Rationale for OS X AppBundle mods below =====
|
||||||
MESSAGE(STATUS "Looking for doxygen...")
|
# With the OS X GUI version, Doxygen likes to be installed to /Applications and
|
||||||
ENDIF (NOT DOXYGEN_FIND_QUIETLY)
|
# it contains the doxygen executable in the bundle. In the versions I've
|
||||||
|
# seen, it is located in Resources, but in general, more often binaries are
|
||||||
|
# located in MacOS.
|
||||||
|
#
|
||||||
|
# NOTE: The official Doxygen.app that is distributed for OS X uses non-standard
|
||||||
|
# conventions. Instead of the command-line "doxygen" tool being placed in
|
||||||
|
# Doxygen.app/Contents/MacOS, "Doxywizard" is placed there instead and
|
||||||
|
# "doxygen" is placed in Contents/Resources. This is most likely done
|
||||||
|
# so that something happens when people double-click on the Doxygen.app
|
||||||
|
# package. Unfortunately, CMake gets confused by this as when it sees the
|
||||||
|
# bundle it uses "Doxywizard" as the executable to use instead of
|
||||||
|
# "doxygen". Therefore to work-around this issue we temporarily disable
|
||||||
|
# the app-bundle feature, just for this CMake module:
|
||||||
|
if(APPLE)
|
||||||
|
# Save the old setting
|
||||||
|
SET(TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE ${CMAKE_FIND_APPBUNDLE})
|
||||||
|
# Disable the App-bundle detection feature
|
||||||
|
SET(CMAKE_FIND_APPBUNDLE "NEVER")
|
||||||
|
endif()
|
||||||
|
# FYI:
|
||||||
|
# In the older versions of OS X Doxygen, dot was included with the
|
||||||
|
# Doxygen bundle. But the new versions require you to download
|
||||||
|
# Graphviz.app which contains "dot" in it's bundle.
|
||||||
|
# ============== End OSX stuff ================
|
||||||
|
|
||||||
|
#
|
||||||
|
# Find Doxygen...
|
||||||
|
#
|
||||||
|
|
||||||
FIND_PROGRAM(DOXYGEN_EXECUTABLE
|
FIND_PROGRAM(DOXYGEN_EXECUTABLE
|
||||||
NAMES doxygen
|
NAMES doxygen
|
||||||
PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\doxygen_is1;Inno Setup: App Path]/bin"
|
PATHS
|
||||||
/Applications/Doxygen.app/Contents/Resources
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\doxygen_is1;Inno Setup: App Path]/bin"
|
||||||
/Applications/Doxygen.app/Contents/MacOS
|
/Applications/Doxygen.app/Contents/Resources
|
||||||
|
/Applications/Doxygen.app/Contents/MacOS
|
||||||
DOC "Doxygen documentation generation tool (http://www.doxygen.org)"
|
DOC "Doxygen documentation generation tool (http://www.doxygen.org)"
|
||||||
)
|
)
|
||||||
|
|
||||||
IF (DOXYGEN_EXECUTABLE)
|
include(FindPackageHandleStandardArgs)
|
||||||
SET (DOXYGEN_FOUND "YES")
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Doxygen DEFAULT_MSG DOXYGEN_EXECUTABLE)
|
||||||
IF (NOT DOXYGEN_FIND_QUIETLY)
|
|
||||||
MESSAGE(STATUS "Looking for doxygen... - found ${DOXYGEN_EXECUTABLE}")
|
|
||||||
ENDIF (NOT DOXYGEN_FIND_QUIETLY)
|
|
||||||
ELSE (DOXYGEN_EXECUTABLE)
|
|
||||||
IF (NOT DOXYGEN_FIND_QUIETLY)
|
|
||||||
IF (DOXYGEN_FIND_REQUIRED)
|
|
||||||
MESSAGE(FATAL_ERROR "Looking for doxygen... - NOT found")
|
|
||||||
ELSE (DOXYGEN_FIND_REQUIRED)
|
|
||||||
MESSAGE(STATUS "Looking for doxygen... - NOT found")
|
|
||||||
ENDIF (DOXYGEN_FIND_REQUIRED)
|
|
||||||
ENDIF (NOT DOXYGEN_FIND_QUIETLY)
|
|
||||||
ENDIF (DOXYGEN_EXECUTABLE)
|
|
||||||
|
|
||||||
# In the older versions of OS X Doxygen, dot was included with the
|
|
||||||
# Doxygen bundle. But the new versions place make you download Graphviz.app
|
|
||||||
# which contains dot in its bundle.
|
|
||||||
IF (NOT DOXYGEN_FIND_QUIETLY)
|
|
||||||
MESSAGE(STATUS "Looking for dot tool...")
|
|
||||||
ENDIF (NOT DOXYGEN_FIND_QUIETLY)
|
|
||||||
|
|
||||||
FIND_PROGRAM(DOXYGEN_DOT_EXECUTABLE
|
#
|
||||||
NAMES dot
|
# Find Dot...
|
||||||
PATHS "$ENV{ProgramFiles}/ATT/Graphviz/bin"
|
#
|
||||||
"C:/Program Files/ATT/Graphviz/bin"
|
|
||||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\ATT\\Graphviz;InstallPath]/bin
|
|
||||||
/Applications/Graphviz.app/Contents/MacOS
|
|
||||||
/Applications/Doxygen.app/Contents/Resources
|
|
||||||
/Applications/Doxygen.app/Contents/MacOS
|
|
||||||
DOC "Graphviz Dot tool for using Doxygen"
|
|
||||||
)
|
|
||||||
|
|
||||||
IF (NOT DOXYGEN_FIND_QUIETLY)
|
IF(NOT DOXYGEN_SKIP_DOT)
|
||||||
IF (DOXYGEN_DOT_EXECUTABLE)
|
FIND_PROGRAM(DOXYGEN_DOT_EXECUTABLE
|
||||||
MESSAGE(STATUS "Looking for dot tool... - found ${DOXYGEN_DOT_EXECUTABLE}")
|
NAMES dot
|
||||||
|
PATHS
|
||||||
|
"$ENV{ProgramFiles}/Graphviz 2.21/bin"
|
||||||
|
"C:/Program Files/Graphviz 2.21/bin"
|
||||||
|
"$ENV{ProgramFiles}/ATT/Graphviz/bin"
|
||||||
|
"C:/Program Files/ATT/Graphviz/bin"
|
||||||
|
[HKEY_LOCAL_MACHINE\\SOFTWARE\\ATT\\Graphviz;InstallPath]/bin
|
||||||
|
/Applications/Graphviz.app/Contents/MacOS
|
||||||
|
/Applications/Doxygen.app/Contents/Resources
|
||||||
|
/Applications/Doxygen.app/Contents/MacOS
|
||||||
|
DOC "Graphviz Dot tool for using Doxygen"
|
||||||
|
)
|
||||||
|
|
||||||
|
if(DOXYGEN_DOT_EXECUTABLE)
|
||||||
|
set(DOXYGEN_DOT_FOUND TRUE)
|
||||||
# The Doxyfile wants the path to Dot, not the entire path and executable
|
# The Doxyfile wants the path to Dot, not the entire path and executable
|
||||||
GET_FILENAME_COMPONENT(DOXYGEN_DOT_PATH "${DOXYGEN_DOT_EXECUTABLE}" PATH CACHE)
|
get_filename_component(DOXYGEN_DOT_PATH "${DOXYGEN_DOT_EXECUTABLE}" PATH CACHE)
|
||||||
ELSE (DOXYGEN_DOT_EXECUTABLE)
|
endif()
|
||||||
MESSAGE(STATUS "Looking for dot tool... - NOT found")
|
|
||||||
ENDIF (DOXYGEN_DOT_EXECUTABLE)
|
endif(NOT DOXYGEN_SKIP_DOT)
|
||||||
ENDIF (NOT DOXYGEN_FIND_QUIETLY)
|
|
||||||
|
#
|
||||||
|
# Backwards compatibility...
|
||||||
|
#
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
# Restore the old app-bundle setting setting
|
||||||
|
SET(CMAKE_FIND_APPBUNDLE ${TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE})
|
||||||
|
endif()
|
||||||
|
|
||||||
# Restore the old app-bundle setting setting
|
# Maintain the _FOUND variables as "YES" or "NO" for backwards compatibility
|
||||||
SET(CMAKE_FIND_APPBUNDLE ${TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE})
|
# (allows people to stuff them directly into Doxyfile with configure_file())
|
||||||
|
if(DOXYGEN_FOUND)
|
||||||
|
set(DOXYGEN_FOUND "YES")
|
||||||
|
else()
|
||||||
|
set(DOXYGEN_FOUND "NO")
|
||||||
|
endif()
|
||||||
|
if(DOXYGEN_DOT_FOUND)
|
||||||
|
set(DOXYGEN_DOT_FOUND "YES")
|
||||||
|
else()
|
||||||
|
set(DOXYGEN_DOT_FOUND "NO")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Backwards compatibility for CMake4.3 and less
|
# For backwards compatibility support
|
||||||
SET (DOXYGEN ${DOXYGEN_EXECUTABLE} )
|
SET (DOXYGEN ${DOXYGEN_EXECUTABLE} )
|
||||||
SET (DOT ${DOXYGEN_DOT_EXECUTABLE} )
|
SET (DOT ${DOXYGEN_DOT_EXECUTABLE} )
|
||||||
|
|
||||||
MARK_AS_ADVANCED(
|
MARK_AS_ADVANCED(
|
||||||
DOXYGEN_FOUND
|
|
||||||
DOXYGEN_EXECUTABLE
|
DOXYGEN_EXECUTABLE
|
||||||
DOXYGEN_DOT_FOUND
|
|
||||||
DOXYGEN_DOT_EXECUTABLE
|
DOXYGEN_DOT_EXECUTABLE
|
||||||
DOXYGEN_DOT_PATH
|
DOXYGEN_DOT_PATH
|
||||||
)
|
)
|
||||||
|
@ -1,19 +1,47 @@
|
|||||||
# - Find MFC on Windows
|
# - Find MFC on Windows
|
||||||
# Find the native MFC - i.e. decide if this is an MS VC box.
|
# Find the native MFC - i.e. decide if an application can link to the MFC
|
||||||
|
# libraries.
|
||||||
# MFC_FOUND - Was MFC support found
|
# MFC_FOUND - Was MFC support found
|
||||||
# You don't need to include anything or link anything to use it.
|
# You don't need to include anything or link anything to use it.
|
||||||
|
|
||||||
# Assume no MFC support
|
# Assume no MFC support
|
||||||
SET( MFC_FOUND "NO" )
|
SET(MFC_FOUND "NO")
|
||||||
# Add MFC support if win32 and not cygwin and not borland
|
|
||||||
IF( WIN32 )
|
|
||||||
IF( NOT CYGWIN )
|
|
||||||
IF( NOT BORLAND )
|
|
||||||
IF( NOT MINGW )
|
|
||||||
SET( MFC_FOUND "YES" )
|
|
||||||
ENDIF( NOT MINGW )
|
|
||||||
ENDIF( NOT BORLAND )
|
|
||||||
ENDIF( NOT CYGWIN )
|
|
||||||
ENDIF( WIN32 )
|
|
||||||
|
|
||||||
|
# Only attempt the try_compile call if it has a chance to succeed:
|
||||||
|
SET(MFC_ATTEMPT_TRY_COMPILE 0)
|
||||||
|
IF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW)
|
||||||
|
SET(MFC_ATTEMPT_TRY_COMPILE 1)
|
||||||
|
ENDIF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW)
|
||||||
|
|
||||||
|
IF(MFC_ATTEMPT_TRY_COMPILE)
|
||||||
|
IF("MFC_HAVE_MFC" MATCHES "^MFC_HAVE_MFC$")
|
||||||
|
SET(CHECK_INCLUDE_FILE_VAR "afxwin.h")
|
||||||
|
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
|
||||||
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx)
|
||||||
|
MESSAGE(STATUS "Looking for MFC")
|
||||||
|
TRY_COMPILE(MFC_HAVE_MFC
|
||||||
|
${CMAKE_BINARY_DIR}
|
||||||
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx
|
||||||
|
CMAKE_FLAGS
|
||||||
|
-DCMAKE_MFC_FLAG:STRING=2
|
||||||
|
-DCOMPILE_DEFINITIONS:STRING=-D_AFXDLL
|
||||||
|
OUTPUT_VARIABLE OUTPUT)
|
||||||
|
IF(MFC_HAVE_MFC)
|
||||||
|
MESSAGE(STATUS "Looking for MFC - found")
|
||||||
|
SET(MFC_HAVE_MFC 1 CACHE INTERNAL "Have MFC?")
|
||||||
|
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
|
"Determining if MFC exists passed with the following output:\n"
|
||||||
|
"${OUTPUT}\n\n")
|
||||||
|
ELSE(MFC_HAVE_MFC)
|
||||||
|
MESSAGE(STATUS "Looking for MFC - not found")
|
||||||
|
SET(MFC_HAVE_MFC 0 CACHE INTERNAL "Have MFC?")
|
||||||
|
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||||
|
"Determining if MFC exists failed with the following output:\n"
|
||||||
|
"${OUTPUT}\n\n")
|
||||||
|
ENDIF(MFC_HAVE_MFC)
|
||||||
|
ENDIF("MFC_HAVE_MFC" MATCHES "^MFC_HAVE_MFC$")
|
||||||
|
|
||||||
|
IF(MFC_HAVE_MFC)
|
||||||
|
SET(MFC_FOUND "YES")
|
||||||
|
ENDIF(MFC_HAVE_MFC)
|
||||||
|
ENDIF(MFC_ATTEMPT_TRY_COMPILE)
|
||||||
|
@ -0,0 +1,108 @@
|
|||||||
|
# - Finds OpenMP support
|
||||||
|
# This module can be used to detect OpenMP support in a compiler.
|
||||||
|
# If the compiler supports OpenMP, the flags required to compile with
|
||||||
|
# openmp support are set.
|
||||||
|
#
|
||||||
|
# The following variables are set:
|
||||||
|
# OpenMP_C_FLAGS - flags to add to the C compiler for OpenMP support
|
||||||
|
# OpenMP_CXX_FLAGS - flags to add to the CXX compiler for OpenMP support
|
||||||
|
# OPENMP_FOUND - true if openmp is detected
|
||||||
|
#
|
||||||
|
# Supported compilers can be found at http://openmp.org/wp/openmp-compilers/
|
||||||
|
|
||||||
|
|
||||||
|
# Copyright 2008, 2009 <André Rigland Brodtkorb> Andre.Brodtkorb@ifi.uio.no
|
||||||
|
#
|
||||||
|
# Redistribution AND use is allowed according to the terms of the New
|
||||||
|
# BSD license.
|
||||||
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||||
|
|
||||||
|
|
||||||
|
include(CheckCSourceCompiles)
|
||||||
|
include(CheckCXXSourceCompiles)
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
|
set(OpenMP_C_FLAG_CANDIDATES
|
||||||
|
#Gnu
|
||||||
|
"-fopenmp"
|
||||||
|
#Microsoft Visual Studio
|
||||||
|
"/openmp"
|
||||||
|
#Intel windows
|
||||||
|
"-Qopenmp"
|
||||||
|
#Intel
|
||||||
|
"-openmp"
|
||||||
|
#Empty, if compiler automatically accepts openmp
|
||||||
|
" "
|
||||||
|
#Sun
|
||||||
|
"-xopenmp"
|
||||||
|
#HP
|
||||||
|
"+Oopenmp"
|
||||||
|
#IBM XL C/c++
|
||||||
|
"-qsmp"
|
||||||
|
#Portland Group
|
||||||
|
"-mp"
|
||||||
|
)
|
||||||
|
set(OpenMP_CXX_FLAG_CANDIDATES ${OpenMP_C_FLAG_CANDIDATES})
|
||||||
|
|
||||||
|
# sample openmp source code to test
|
||||||
|
set(OpenMP_C_TEST_SOURCE
|
||||||
|
"
|
||||||
|
#include <omp.h>
|
||||||
|
int main() {
|
||||||
|
#ifdef _OPENMP
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
|
breaks_on_purpose
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
")
|
||||||
|
# use the same source for CXX as C for now
|
||||||
|
set(OpenMP_CXX_TEST_SOURCE ${OpenMP_C_TEST_SOURCE})
|
||||||
|
# if these are set then do not try to find them again,
|
||||||
|
# by avoiding any try_compiles for the flags
|
||||||
|
if(DEFINED OpenMP_C_FLAGS AND DEFINED OpenMP_CXX_FLAGS)
|
||||||
|
set(OpenMP_C_FLAG_CANDIDATES)
|
||||||
|
set(OpenMP_CXX_FLAG_CANDIDATES)
|
||||||
|
endif(DEFINED OpenMP_C_FLAGS AND DEFINED OpenMP_CXX_FLAGS)
|
||||||
|
|
||||||
|
# check c compiler
|
||||||
|
foreach(FLAG ${OpenMP_C_FLAG_CANDIDATES})
|
||||||
|
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
||||||
|
set(CMAKE_REQUIRED_FLAGS "${FLAG}")
|
||||||
|
unset(OpenMP_FLAG_DETECTED CACHE)
|
||||||
|
message(STATUS "Try OpenMP C flag = [${FLAG}]")
|
||||||
|
check_c_source_compiles("${OpenMP_CXX_TEST_SOURCE}" OpenMP_FLAG_DETECTED)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
|
||||||
|
if(OpenMP_FLAG_DETECTED)
|
||||||
|
set(OpenMP_C_FLAGS_INTERNAL "${FLAG}")
|
||||||
|
break()
|
||||||
|
endif(OpenMP_FLAG_DETECTED)
|
||||||
|
endforeach(FLAG ${OpenMP_C_FLAG_CANDIDATES})
|
||||||
|
|
||||||
|
# check cxx compiler
|
||||||
|
foreach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES})
|
||||||
|
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
||||||
|
set(CMAKE_REQUIRED_FLAGS "${FLAG}")
|
||||||
|
unset(OpenMP_FLAG_DETECTED CACHE)
|
||||||
|
message(STATUS "Try OpenMP CXX flag = [${FLAG}]")
|
||||||
|
check_cxx_source_compiles("${OpenMP_C_TEST_SOURCE}" OpenMP_FLAG_DETECTED)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
|
||||||
|
if(OpenMP_FLAG_DETECTED)
|
||||||
|
set(OpenMP_CXX_FLAGS_INTERNAL "${FLAG}")
|
||||||
|
break()
|
||||||
|
endif(OpenMP_FLAG_DETECTED)
|
||||||
|
endforeach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES})
|
||||||
|
|
||||||
|
set(OpenMP_C_FLAGS "${OpenMP_C_FLAGS_INTERNAL}"
|
||||||
|
CACHE STRING "C compiler flags for OpenMP parallization")
|
||||||
|
|
||||||
|
set(OpenMP_CXX_FLAGS "${OpenMP_CXX_FLAGS_INTERNAL}"
|
||||||
|
CACHE STRING "C++ compiler flags for OpenMP parallization")
|
||||||
|
# handle the standard arguments for find_package
|
||||||
|
find_package_handle_standard_args(OpenMP DEFAULT_MSG
|
||||||
|
OpenMP_C_FLAGS OpenMP_CXX_FLAGS )
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
|
OpenMP_C_FLAGS
|
||||||
|
OpenMP_CXX_FLAGS
|
||||||
|
)
|
@ -0,0 +1,213 @@
|
|||||||
|
# - Find OpenSceneGraph
|
||||||
|
# This module searches for the OpenSceneGraph core "osg" library as well as
|
||||||
|
# OpenThreads, and whatever additional COMPONENTS that you specify.
|
||||||
|
# See http://www.openscenegraph.org
|
||||||
|
#
|
||||||
|
# NOTE: If you would like to use this module in your CMAKE_MODULE_PATH instead
|
||||||
|
# of requiring CMake >= 2.6.3, you will also need to download
|
||||||
|
# FindOpenThreads.cmake, Findosg_functions.cmake, Findosg.cmake, as well as
|
||||||
|
# files for any Components you need to call (FindosgDB.cmake,
|
||||||
|
# FindosgUtil.cmake, etc.)
|
||||||
|
#
|
||||||
|
#==================================
|
||||||
|
#
|
||||||
|
# This module accepts the following variables (note mixed case)
|
||||||
|
#
|
||||||
|
# OpenSceneGraph_DEBUG - Enable debugging output
|
||||||
|
#
|
||||||
|
# OpenSceneGraph_MARK_AS_ADVANCED - Mark cache variables as advanced
|
||||||
|
# automatically
|
||||||
|
#
|
||||||
|
# The following environment variables are also respected for finding the OSG
|
||||||
|
# and it's various components. CMAKE_PREFIX_PATH can also be used for this
|
||||||
|
# (see find_library() CMake documentation).
|
||||||
|
#
|
||||||
|
# <MODULE>_DIR (where MODULE is of the form "OSGVOLUME" and there is a FindosgVolume.cmake file)
|
||||||
|
# OSG_DIR
|
||||||
|
# OSGDIR
|
||||||
|
# OSG_ROOT
|
||||||
|
#
|
||||||
|
# This module defines the following output variables:
|
||||||
|
#
|
||||||
|
# OPENSCENEGRAPH_FOUND - Was the OSG and all of the specified components found?
|
||||||
|
#
|
||||||
|
# OPENSCENEGRAPH_VERSION - The version of the OSG which was found
|
||||||
|
#
|
||||||
|
# OPENSCENEGRAPH_INCLUDE_DIRS - Where to find the headers
|
||||||
|
#
|
||||||
|
# OPENSCENEGRAPH_LIBRARIES - The OSG libraries
|
||||||
|
#
|
||||||
|
#==================================
|
||||||
|
# Example Usage:
|
||||||
|
#
|
||||||
|
# find_package(OpenSceneGraph 2.0.0 COMPONENTS osgDB osgUtil)
|
||||||
|
# include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS})
|
||||||
|
#
|
||||||
|
# add_executable(foo foo.cc)
|
||||||
|
# target_link_libraries(foo ${OPENSCENEGRAPH_LIBRARIES})
|
||||||
|
#
|
||||||
|
#==================================
|
||||||
|
#
|
||||||
|
# Naming convention:
|
||||||
|
# Local variables of the form _osg_foo
|
||||||
|
# Input variables of the form OpenSceneGraph_FOO
|
||||||
|
# Output variables of the form OPENSCENEGRAPH_FOO
|
||||||
|
#
|
||||||
|
# Copyright (c) 2009, Philip Lowman <philip@yhbt.com>
|
||||||
|
#
|
||||||
|
# Redistribution AND use is allowed according to the terms of the New
|
||||||
|
# BSD license.
|
||||||
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||||
|
#
|
||||||
|
#==================================
|
||||||
|
|
||||||
|
include(Findosg_functions)
|
||||||
|
|
||||||
|
set(_osg_modules_to_process)
|
||||||
|
foreach(_osg_component ${OpenSceneGraph_FIND_COMPONENTS})
|
||||||
|
list(APPEND _osg_modules_to_process ${_osg_component})
|
||||||
|
endforeach()
|
||||||
|
list(APPEND _osg_modules_to_process "osg" "OpenThreads")
|
||||||
|
list(REMOVE_DUPLICATES _osg_modules_to_process)
|
||||||
|
|
||||||
|
if(OpenSceneGraph_DEBUG)
|
||||||
|
message("[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] "
|
||||||
|
"Components = ${_osg_modules_to_process}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#
|
||||||
|
# First we need to find and parse osg/Version
|
||||||
|
#
|
||||||
|
OSG_FIND_PATH(OSG osg/Version)
|
||||||
|
if(OpenSceneGraph_MARK_AS_ADVANCED)
|
||||||
|
OSG_MARK_AS_ADVANCED(OSG)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Try to ascertain the version...
|
||||||
|
if(OSG_INCLUDE_DIR)
|
||||||
|
if(OpenSceneGraph_DEBUG)
|
||||||
|
message("[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] "
|
||||||
|
"Detected OSG_INCLUDE_DIR = ${OSG_INCLUDE_DIR}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
file(READ "${OSG_INCLUDE_DIR}/osg/Version" _osg_Version_contents)
|
||||||
|
|
||||||
|
string(REGEX MATCH ".*#define OSG_VERSION_MAJOR[ \t]+[0-9]+.*"
|
||||||
|
_osg_old_defines ${_osg_Version_contents})
|
||||||
|
string(REGEX MATCH ".*#define OPENSCENEGRAPH_MAJOR_VERSION[ \t]+[0-9]+.*"
|
||||||
|
_osg_new_defines ${_osg_Version_contents})
|
||||||
|
if(_osg_old_defines)
|
||||||
|
string(REGEX REPLACE ".*#define OSG_VERSION_MAJOR[ \t]+([0-9]+).*"
|
||||||
|
"\\1" _osg_VERSION_MAJOR ${_osg_Version_contents})
|
||||||
|
string(REGEX REPLACE ".*#define OSG_VERSION_MINOR[ \t]+([0-9]+).*"
|
||||||
|
"\\1" _osg_VERSION_MINOR ${_osg_Version_contents})
|
||||||
|
string(REGEX REPLACE ".*#define OSG_VERSION_PATCH[ \t]+([0-9]+).*"
|
||||||
|
"\\1" _osg_VERSION_PATCH ${_osg_Version_contents})
|
||||||
|
elseif(_osg_new_defines)
|
||||||
|
string(REGEX REPLACE ".*#define OPENSCENEGRAPH_MAJOR_VERSION[ \t]+([0-9]+).*"
|
||||||
|
"\\1" _osg_VERSION_MAJOR ${_osg_Version_contents})
|
||||||
|
string(REGEX REPLACE ".*#define OPENSCENEGRAPH_MINOR_VERSION[ \t]+([0-9]+).*"
|
||||||
|
"\\1" _osg_VERSION_MINOR ${_osg_Version_contents})
|
||||||
|
string(REGEX REPLACE ".*#define OPENSCENEGRAPH_PATCH_VERSION[ \t]+([0-9]+).*"
|
||||||
|
"\\1" _osg_VERSION_PATCH ${_osg_Version_contents})
|
||||||
|
else()
|
||||||
|
message("[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] "
|
||||||
|
"Failed to parse version number, please report this as a bug")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(OPENSCENEGRAPH_VERSION "${_osg_VERSION_MAJOR}.${_osg_VERSION_MINOR}.${_osg_VERSION_PATCH}"
|
||||||
|
CACHE INTERNAL "The version of OSG which was detected")
|
||||||
|
if(OpenSceneGraph_DEBUG)
|
||||||
|
message("[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] "
|
||||||
|
"Detected version ${OPENSCENEGRAPH_VERSION}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#
|
||||||
|
# Version checking
|
||||||
|
#
|
||||||
|
if(OpenSceneGraph_FIND_VERSION)
|
||||||
|
if(OpenSceneGraph_FIND_VERSION_EXACT)
|
||||||
|
if(NOT OPENSCENEGRAPH_VERSION VERSION_EQUAL ${OpenSceneGraph_FIND_VERSION})
|
||||||
|
set(_osg_version_not_exact TRUE)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
# version is too low
|
||||||
|
if(NOT OPENSCENEGRAPH_VERSION VERSION_EQUAL ${OpenSceneGraph_FIND_VERSION} AND
|
||||||
|
NOT OPENSCENEGRAPH_VERSION VERSION_GREATER ${OpenSceneGraph_FIND_VERSION})
|
||||||
|
set(_osg_version_not_high_enough TRUE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(_osg_required)
|
||||||
|
set(_osg_quiet)
|
||||||
|
if(OpenSceneGraph_FIND_REQUIRED)
|
||||||
|
set(_osg_required "REQUIRED")
|
||||||
|
endif()
|
||||||
|
if(OpenSceneGraph_FIND_QUIETLY)
|
||||||
|
set(_osg_quiet "QUIET")
|
||||||
|
endif()
|
||||||
|
#
|
||||||
|
# Here we call FIND_PACKAGE() on all of the components
|
||||||
|
#
|
||||||
|
foreach(_osg_module ${_osg_modules_to_process})
|
||||||
|
if(OpenSceneGraph_DEBUG)
|
||||||
|
message("[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] "
|
||||||
|
"Calling find_package(${_osg_module} ${_osg_required} ${_osg_quiet})")
|
||||||
|
endif()
|
||||||
|
find_package(${_osg_module} ${_osg_required} ${_osg_quiet})
|
||||||
|
|
||||||
|
string(TOUPPER ${_osg_module} _osg_module_UC)
|
||||||
|
list(APPEND OPENSCENEGRAPH_INCLUDE_DIR ${${_osg_module_UC}_INCLUDE_DIR})
|
||||||
|
list(APPEND OPENSCENEGRAPH_LIBRARIES ${${_osg_module_UC}_LIBRARIES})
|
||||||
|
|
||||||
|
if(OpenSceneGraph_MARK_AS_ADVANCED)
|
||||||
|
OSG_MARK_AS_ADVANCED(${_osg_module})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
if(OPENSCENEGRAPH_INCLUDE_DIR)
|
||||||
|
list(REMOVE_DUPLICATES OPENSCENEGRAPH_INCLUDE_DIR)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#
|
||||||
|
# Inform the users with an error message based on
|
||||||
|
# what version they have vs. what version was
|
||||||
|
# required.
|
||||||
|
#
|
||||||
|
if(OpenSceneGraph_FIND_REQUIRED)
|
||||||
|
set(_osg_version_output_type FATAL_ERROR)
|
||||||
|
else()
|
||||||
|
set(_osg_version_output_type STATUS)
|
||||||
|
endif()
|
||||||
|
if(_osg_version_not_high_enough)
|
||||||
|
set(_osg_EPIC_FAIL TRUE)
|
||||||
|
if(NOT OpenSceneGraph_FIND_QUIETLY)
|
||||||
|
message(${_osg_version_output_type}
|
||||||
|
"ERROR: Version ${OpenSceneGraph_FIND_VERSION} or higher of the OSG "
|
||||||
|
"is required. Version ${OPENSCENEGRAPH_VERSION} was found.")
|
||||||
|
endif()
|
||||||
|
elseif(_osg_version_not_exact)
|
||||||
|
set(_osg_EPIC_FAIL TRUE)
|
||||||
|
if(NOT OpenSceneGraph_FIND_QUIETLY)
|
||||||
|
message(${_osg_version_output_type}
|
||||||
|
"ERROR: Version ${OpenSceneGraph_FIND_VERSION} of the OSG is required "
|
||||||
|
"(exactly), version ${OPENSCENEGRAPH_VERSION} was found.")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
# If the version was OK, we should hit this case where we can do the
|
||||||
|
# typical user notifications
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenSceneGraph DEFAULT_MSG OPENSCENEGRAPH_LIBRARIES OPENSCENEGRAPH_INCLUDE_DIR)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(_osg_EPIC_FAIL)
|
||||||
|
# Zero out everything, we didn't meet version requirements
|
||||||
|
set(OPENSCENEGRAPH_FOUND FALSE)
|
||||||
|
set(OPENSCENEGRAPH_LIBRARIES)
|
||||||
|
set(OPENSCENEGRAPH_INCLUDE_DIR)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(OPENSCENEGRAPH_INCLUDE_DIRS ${OPENSCENEGRAPH_INCLUDE_DIR})
|
||||||
|
|
@ -0,0 +1,88 @@
|
|||||||
|
# - Try to find M&S HLA RTI libraries
|
||||||
|
# This module finds if any HLA RTI is installed and locates the standard RTI
|
||||||
|
# include files and libraries.
|
||||||
|
#
|
||||||
|
# RTI is a simulation infrastructure standartized by IEEE and SISO. It has a
|
||||||
|
# well defined C++ API that assures that simulation applications are
|
||||||
|
# independent on a particular RTI implementation.
|
||||||
|
# http://en.wikipedia.org/wiki/Run-Time_Infrastructure_(simulation)
|
||||||
|
#
|
||||||
|
# This code sets the following variables:
|
||||||
|
# RTI_INCLUDE_DIR = the directory where RTI includes file are found
|
||||||
|
# RTI_LIBRARIES = The libraries to link against to use RTI
|
||||||
|
# RTI_DEFINITIONS = -DRTI_USES_STD_FSTREAM
|
||||||
|
# RTI_FOUND = Set to FALSE if any HLA RTI was not found
|
||||||
|
#
|
||||||
|
# Report problems to <certi-devel@nongnu.org>
|
||||||
|
|
||||||
|
MACRO(RTI_MESSAGE_QUIETLY QUIET TYPE MSG)
|
||||||
|
IF(NOT ${QUIET})
|
||||||
|
MESSAGE(${TYPE} "${MSG}")
|
||||||
|
ENDIF(NOT ${QUIET})
|
||||||
|
ENDMACRO(RTI_MESSAGE_QUIETLY QUIET TYPE MSG)
|
||||||
|
|
||||||
|
# Detect the CERTI installation, http://www.cert.fr/CERTI
|
||||||
|
IF ("$ENV{CERTI_HOME}" STRGREATER "")
|
||||||
|
FILE(TO_CMAKE_PATH "$ENV{CERTI_HOME}" CERTI_HOME)
|
||||||
|
RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "Using environment defined CERTI_HOME: ${CERTI_HOME}")
|
||||||
|
ENDIF ("$ENV{CERTI_HOME}" STRGREATER "")
|
||||||
|
|
||||||
|
SET(RTI_DEFINITIONS "-DRTI_USES_STD_FSTREAM")
|
||||||
|
|
||||||
|
# Detect the MAK Technologies RTI installation, http://www.mak.com/products/rti.php
|
||||||
|
# note: the following list is ordered to find the most recent version first
|
||||||
|
SET(RTI_POSSIBLE_DIRS
|
||||||
|
${CERTI_HOME}
|
||||||
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MAK Technologies\\MAK RTI 3.2 MSVC++ 8.0;Location]"
|
||||||
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MAK RTI 3.2-win32-msvc++8.0;InstallLocation]"
|
||||||
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MAK Technologies\\MAK RTI 2.2;Location]"
|
||||||
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MAK RTI 2.2;InstallLocation]")
|
||||||
|
|
||||||
|
SET(RTI_OLD_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
|
||||||
|
# The MAK RTI has the "lib" prefix even on Windows.
|
||||||
|
SET(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
|
||||||
|
|
||||||
|
FIND_LIBRARY(RTI_LIBRARY
|
||||||
|
NAMES RTI RTI-NG
|
||||||
|
PATHS ${RTI_POSSIBLE_DIRS}
|
||||||
|
PATH_SUFFIXES lib
|
||||||
|
DOC "The RTI Library")
|
||||||
|
|
||||||
|
IF (RTI_LIBRARY)
|
||||||
|
SET(RTI_LIBRARIES ${RTI_LIBRARY})
|
||||||
|
RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI library found: ${RTI_LIBRARY}")
|
||||||
|
ELSE (RTI_LIBRARY)
|
||||||
|
RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI library NOT found")
|
||||||
|
ENDIF (RTI_LIBRARY)
|
||||||
|
|
||||||
|
FIND_LIBRARY(RTI_FEDTIME_LIBRARY
|
||||||
|
NAMES FedTime
|
||||||
|
PATHS ${RTI_POSSIBLE_DIRS}
|
||||||
|
PATH_SUFFIXES lib
|
||||||
|
DOC "The FedTime Library")
|
||||||
|
|
||||||
|
IF (RTI_FEDTIME_LIBRARY)
|
||||||
|
SET(RTI_LIBRARIES ${RTI_LIBRARIES} ${RTI_FEDTIME_LIBRARY})
|
||||||
|
RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI FedTime found: ${RTI_FEDTIME_LIBRARY}")
|
||||||
|
ENDIF (RTI_FEDTIME_LIBRARY)
|
||||||
|
|
||||||
|
FIND_PATH(RTI_INCLUDE_DIR
|
||||||
|
NAMES RTI.hh
|
||||||
|
PATHS ${RTI_POSSIBLE_DIRS}
|
||||||
|
PATH_SUFFIXES include
|
||||||
|
DOC "The RTI Include Files")
|
||||||
|
|
||||||
|
IF (RTI_INCLUDE_DIR)
|
||||||
|
RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI headers found: ${RTI_INCLUDE_DIR}")
|
||||||
|
ELSE (RTI_INCLUDE_DIR)
|
||||||
|
RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI headers NOT found")
|
||||||
|
ENDIF (RTI_INCLUDE_DIR)
|
||||||
|
|
||||||
|
# Set the modified system variables back to the original value.
|
||||||
|
SET(CMAKE_FIND_LIBRARY_PREFIXES "${RTI_OLD_FIND_LIBRARY_PREFIXES}")
|
||||||
|
|
||||||
|
INCLUDE(FindPackageHandleStandardArgs)
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(RTI DEFAULT_MSG
|
||||||
|
RTI_LIBRARY RTI_INCLUDE_DIR)
|
||||||
|
|
||||||
|
# $Id: FindRTI.cmake,v 1.3.2.2 2009-02-04 16:44:12 hoffman Exp $
|
@ -0,0 +1,119 @@
|
|||||||
|
#
|
||||||
|
# ---- Find Squish
|
||||||
|
# This module can be used to find Squish (currently support is aimed at version 3).
|
||||||
|
#
|
||||||
|
# ---- Variables and Macros
|
||||||
|
# SQUISH_FOUND If false, don't try to use Squish
|
||||||
|
# SQUISH_VERSION_MAJOR The major version of Squish found
|
||||||
|
# SQUISH_VERSION_MINOR The minor version of Squish found
|
||||||
|
# SQUISH_VERSION_PATCH The patch version of Squish found
|
||||||
|
#
|
||||||
|
# SQUISH_INSTALL_DIR The Squish installation directory (containing bin, lib, etc)
|
||||||
|
# SQUISH_SERVER_EXECUTABLE The squishserver executable
|
||||||
|
# SQUISH_CLIENT_EXECUTABLE The squishrunner executable
|
||||||
|
#
|
||||||
|
# SQUISH_INSTALL_DIR_FOUND Was the install directory found?
|
||||||
|
# SQUISH_SERVER_EXECUTABLE_FOUND Was the server executable found?
|
||||||
|
# SQUISH_CLIENT_EXECUTABLE_FOUND Was the client executable found?
|
||||||
|
#
|
||||||
|
# macro SQUISH_ADD_TEST(testName applicationUnderTest testSuite testCase)
|
||||||
|
#
|
||||||
|
# ---- Typical Use
|
||||||
|
# ENABLE_TESTING()
|
||||||
|
# FIND_PACKAGE(Squish)
|
||||||
|
# IF (SQUISH_FOUND)
|
||||||
|
# SQUISH_ADD_TEST(myTestName myApplication testSuiteName testCaseName)
|
||||||
|
# ENDIF (SQUISH_FOUND)
|
||||||
|
#
|
||||||
|
|
||||||
|
SET(SQUISH_INSTALL_DIR_STRING "Directory containing the bin, doc, and lib directories for Squish; this should be the root of the installation directory.")
|
||||||
|
SET(SQUISH_SERVER_EXECUTABLE_STRING "The squishserver executable program.")
|
||||||
|
SET(SQUISH_CLIENT_EXECUTABLE_STRING "The squishclient executable program.")
|
||||||
|
|
||||||
|
# Search only if the location is not already known.
|
||||||
|
IF(NOT SQUISH_INSTALL_DIR)
|
||||||
|
# Get the system search path as a list.
|
||||||
|
IF(UNIX)
|
||||||
|
STRING(REGEX MATCHALL "[^:]+" SQUISH_INSTALL_DIR_SEARCH1 "$ENV{PATH}")
|
||||||
|
ELSE(UNIX)
|
||||||
|
STRING(REGEX REPLACE "\\\\" "/" SQUISH_INSTALL_DIR_SEARCH1 "$ENV{PATH}")
|
||||||
|
ENDIF(UNIX)
|
||||||
|
STRING(REGEX REPLACE "/;" ";" SQUISH_INSTALL_DIR_SEARCH2 ${SQUISH_INSTALL_DIR_SEARCH1})
|
||||||
|
|
||||||
|
# Construct a set of paths relative to the system search path.
|
||||||
|
SET(SQUISH_INSTALL_DIR_SEARCH "")
|
||||||
|
FOREACH(dir ${SQUISH_INSTALL_DIR_SEARCH2})
|
||||||
|
SET(SQUISH_INSTALL_DIR_SEARCH ${SQUISH_INSTALL_DIR_SEARCH} "${dir}/../lib/fltk")
|
||||||
|
ENDFOREACH(dir)
|
||||||
|
|
||||||
|
# Look for an installation
|
||||||
|
FIND_PATH(SQUISH_INSTALL_DIR bin/squishrunner
|
||||||
|
# Look for an environment variable SQUISH_INSTALL_DIR.
|
||||||
|
$ENV{SQUISH_INSTALL_DIR}
|
||||||
|
|
||||||
|
# Look in places relative to the system executable search path.
|
||||||
|
${SQUISH_INSTALL_DIR_SEARCH}
|
||||||
|
|
||||||
|
# Look in standard UNIX install locations.
|
||||||
|
#/usr/local/squish
|
||||||
|
|
||||||
|
DOC "The ${SQUISH_INSTALL_DIR_STRING}"
|
||||||
|
)
|
||||||
|
ENDIF(NOT SQUISH_INSTALL_DIR)
|
||||||
|
|
||||||
|
# search for the executables
|
||||||
|
IF(SQUISH_INSTALL_DIR)
|
||||||
|
SET(SQUISH_INSTALL_DIR_FOUND 1)
|
||||||
|
|
||||||
|
# find the client program
|
||||||
|
IF(NOT SQUISH_CLIENT_EXECUTABLE)
|
||||||
|
FIND_PROGRAM(SQUISH_CLIENT_EXECUTABLE ${SQUISH_INSTALL_DIR}/bin/squishrunner DOC "The ${SQUISH_CLIENT_EXECUTABLE_STRING}")
|
||||||
|
ENDIF(NOT SQUISH_CLIENT_EXECUTABLE)
|
||||||
|
|
||||||
|
# find the server program
|
||||||
|
IF(NOT SQUISH_SERVER_EXECUTABLE)
|
||||||
|
FIND_PROGRAM(SQUISH_SERVER_EXECUTABLE ${SQUISH_INSTALL_DIR}/bin/squishserver DOC "The ${SQUISH_SERVER_EXECUTABLE_STRING}")
|
||||||
|
ENDIF(NOT SQUISH_SERVER_EXECUTABLE)
|
||||||
|
|
||||||
|
ELSE(SQUISH_INSTALL_DIR)
|
||||||
|
SET(SQUISH_INSTALL_DIR_FOUND 0)
|
||||||
|
ENDIF(SQUISH_INSTALL_DIR)
|
||||||
|
|
||||||
|
# record if executables are set
|
||||||
|
IF(SQUISH_CLIENT_EXECUTABLE)
|
||||||
|
SET(SQUISH_CLIENT_EXECUTABLE_FOUND 1)
|
||||||
|
ELSE(SQUISH_CLIENT_EXECUTABLE)
|
||||||
|
SET(SQUISH_CLIENT_EXECUTABLE_FOUND 0)
|
||||||
|
ENDIF(SQUISH_CLIENT_EXECUTABLE)
|
||||||
|
|
||||||
|
IF(SQUISH_SERVER_EXECUTABLE)
|
||||||
|
SET(SQUISH_SERVER_EXECUTABLE_FOUND 1)
|
||||||
|
ELSE(SQUISH_SERVER_EXECUTABLE)
|
||||||
|
SET(SQUISH_SERVER_EXECUTABLE_FOUND 0)
|
||||||
|
ENDIF(SQUISH_SERVER_EXECUTABLE)
|
||||||
|
|
||||||
|
# record if Squish was found
|
||||||
|
SET(SQUISH_FOUND 1)
|
||||||
|
FOREACH(var SQUISH_INSTALL_DIR_FOUND SQUISH_CLIENT_EXECUTABLE_FOUND SQUISH_SERVER_EXECUTABLE_FOUND)
|
||||||
|
IF(NOT ${var})
|
||||||
|
SET(SQUISH_FOUND 0)
|
||||||
|
ENDIF(NOT ${var})
|
||||||
|
ENDFOREACH(var)
|
||||||
|
|
||||||
|
MACRO(SQUISH_ADD_TEST testName testAUT testCase envVars testWraper)
|
||||||
|
ADD_TEST(${testName}
|
||||||
|
${CMAKE_COMMAND} -V -VV
|
||||||
|
"-Dsquish_aut:STRING=${testAUT}"
|
||||||
|
"-Dsquish_server_executable:STRING=${SQUISH_SERVER_EXECUTABLE}"
|
||||||
|
"-Dsquish_client_executable:STRING=${SQUISH_CLIENT_EXECUTABLE}"
|
||||||
|
"-Dsquish_libqtdir:STRING=${QT_LIBRARY_DIR}"
|
||||||
|
"-Dsquish_test_case:STRING=${testCase}"
|
||||||
|
"-Dsquish_env_vars:STRING=${envVars}"
|
||||||
|
"-Dsquish_wrapper:STRING=${testWraper}"
|
||||||
|
-P "${CMAKE_ROOT}/Modules/SquishTestScript.cmake"
|
||||||
|
)
|
||||||
|
SET_TESTS_PROPERTIES(${testName}
|
||||||
|
PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED;ERROR;FATAL"
|
||||||
|
)
|
||||||
|
ENDMACRO(SQUISH_ADD_TEST)
|
||||||
|
|
@ -0,0 +1,38 @@
|
|||||||
|
# This is part of the Findosg* suite used to find OpenSceneGraph components.
|
||||||
|
# Each component is separate and you must opt in to each module. You must
|
||||||
|
# also opt into OpenGL and OpenThreads (and Producer if needed) as these
|
||||||
|
# modules won't do it for you. This is to allow you control over your own
|
||||||
|
# system piece by piece in case you need to opt out of certain components
|
||||||
|
# or change the Find behavior for a particular module (perhaps because the
|
||||||
|
# default FindOpenGL.cmake module doesn't work with your system as an
|
||||||
|
# example).
|
||||||
|
# If you want to use a more convenient module that includes everything,
|
||||||
|
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
|
||||||
|
#
|
||||||
|
# Locate osgAnimation
|
||||||
|
# This module defines
|
||||||
|
#
|
||||||
|
# OSGANIMATION_FOUND - Was osgAnimation found?
|
||||||
|
# OSGANIMATION_INCLUDE_DIR - Where to find the headers
|
||||||
|
# OSGANIMATION_LIBRARIES - The libraries to link against for the OSG (use this)
|
||||||
|
#
|
||||||
|
# OSGANIMATION_LIBRARY - The OSG library
|
||||||
|
# OSGANIMATION_LIBRARY_DEBUG - The OSG debug library
|
||||||
|
#
|
||||||
|
# $OSGDIR is an environment variable that would
|
||||||
|
# correspond to the ./configure --prefix=$OSGDIR
|
||||||
|
# used in building osg.
|
||||||
|
#
|
||||||
|
# Created by Eric Wing.
|
||||||
|
|
||||||
|
# Header files are presumed to be included like
|
||||||
|
# #include <osg/PositionAttitudeTransform>
|
||||||
|
# #include <osgAnimation/Animation>
|
||||||
|
|
||||||
|
include(Findosg_functions)
|
||||||
|
OSG_FIND_PATH (OSGANIMATION osgAnimation/Animation)
|
||||||
|
OSG_FIND_LIBRARY(OSGANIMATION osgAnimation)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgAnimation DEFAULT_MSG
|
||||||
|
OSGANIMATION_LIBRARY OSGANIMATION_INCLUDE_DIR)
|
@ -0,0 +1,38 @@
|
|||||||
|
# This is part of the Findosg* suite used to find OpenSceneGraph components.
|
||||||
|
# Each component is separate and you must opt in to each module. You must
|
||||||
|
# also opt into OpenGL and OpenThreads (and Producer if needed) as these
|
||||||
|
# modules won't do it for you. This is to allow you control over your own
|
||||||
|
# system piece by piece in case you need to opt out of certain components
|
||||||
|
# or change the Find behavior for a particular module (perhaps because the
|
||||||
|
# default FindOpenGL.cmake module doesn't work with your system as an
|
||||||
|
# example).
|
||||||
|
# If you want to use a more convenient module that includes everything,
|
||||||
|
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
|
||||||
|
#
|
||||||
|
# Locate osgVolume
|
||||||
|
# This module defines
|
||||||
|
#
|
||||||
|
# OSGVOLUME_FOUND - Was osgVolume found?
|
||||||
|
# OSGVOLUME_INCLUDE_DIR - Where to find the headers
|
||||||
|
# OSGVOLUME_LIBRARIES - The libraries to link for osgVolume (use this)
|
||||||
|
#
|
||||||
|
# OSGVOLUME_LIBRARY - The osgVolume library
|
||||||
|
# OSGVOLUME_LIBRARY_DEBUG - The osgVolume debug library
|
||||||
|
#
|
||||||
|
# $OSGDIR is an environment variable that would
|
||||||
|
# correspond to the ./configure --prefix=$OSGDIR
|
||||||
|
# used in building osg.
|
||||||
|
#
|
||||||
|
# Created by Eric Wing.
|
||||||
|
|
||||||
|
# Header files are presumed to be included like
|
||||||
|
# #include <osg/PositionAttitudeTransform>
|
||||||
|
# #include <osgVolume/Volume>
|
||||||
|
|
||||||
|
include(Findosg_functions)
|
||||||
|
OSG_FIND_PATH (OSGVOLUME osgVolume/Volume)
|
||||||
|
OSG_FIND_LIBRARY(OSGVOLUME osgVolume)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgVolume DEFAULT_MSG
|
||||||
|
OSGVOLUME_LIBRARY OSGVOLUME_INCLUDE_DIR)
|
@ -0,0 +1,38 @@
|
|||||||
|
# This is part of the Findosg* suite used to find OpenSceneGraph components.
|
||||||
|
# Each component is separate and you must opt in to each module. You must
|
||||||
|
# also opt into OpenGL and OpenThreads (and Producer if needed) as these
|
||||||
|
# modules won't do it for you. This is to allow you control over your own
|
||||||
|
# system piece by piece in case you need to opt out of certain components
|
||||||
|
# or change the Find behavior for a particular module (perhaps because the
|
||||||
|
# default FindOpenGL.cmake module doesn't work with your system as an
|
||||||
|
# example).
|
||||||
|
# If you want to use a more convenient module that includes everything,
|
||||||
|
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
|
||||||
|
#
|
||||||
|
# Locate osgWidget
|
||||||
|
# This module defines
|
||||||
|
#
|
||||||
|
# OSGWIDGET_FOUND - Was osgWidget found?
|
||||||
|
# OSGWIDGET_INCLUDE_DIR - Where to find the headers
|
||||||
|
# OSGWIDGET_LIBRARIES - The libraries to link for osgWidget (use this)
|
||||||
|
#
|
||||||
|
# OSGWIDGET_LIBRARY - The osgWidget library
|
||||||
|
# OSGWIDGET_LIBRARY_DEBUG - The osgWidget debug library
|
||||||
|
#
|
||||||
|
# $OSGDIR is an environment variable that would
|
||||||
|
# correspond to the ./configure --prefix=$OSGDIR
|
||||||
|
# used in building osg.
|
||||||
|
#
|
||||||
|
# FindosgWidget.cmake tweaked from Findosg* suite as created by Eric Wing.
|
||||||
|
|
||||||
|
# Header files are presumed to be included like
|
||||||
|
# #include <osg/PositionAttitudeTransform>
|
||||||
|
# #include <osgWidget/Widget>
|
||||||
|
|
||||||
|
include(Findosg_functions)
|
||||||
|
OSG_FIND_PATH (OSGWIDGET osgWidget/Widget)
|
||||||
|
OSG_FIND_LIBRARY(OSGWIDGET osgWidget)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgWidget DEFAULT_MSG
|
||||||
|
OSGWIDGET_LIBRARY OSGWIDGET_INCLUDE_DIR)
|
@ -0,0 +1,91 @@
|
|||||||
|
#
|
||||||
|
# This CMake file contains two macros to assist with searching for OSG
|
||||||
|
# libraries and nodekits.
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# OSG_FIND_PATH
|
||||||
|
#
|
||||||
|
function(OSG_FIND_PATH module header)
|
||||||
|
string(TOUPPER ${module} module_uc)
|
||||||
|
|
||||||
|
# Try the user's environment request before anything else.
|
||||||
|
find_path(${module_uc}_INCLUDE_DIR ${header}
|
||||||
|
HINTS
|
||||||
|
$ENV{${module_uc}_DIR}
|
||||||
|
$ENV{OSG_DIR}
|
||||||
|
$ENV{OSGDIR}
|
||||||
|
$ENV{OSG_ROOT}
|
||||||
|
PATH_SUFFIXES include
|
||||||
|
PATHS
|
||||||
|
/sw # Fink
|
||||||
|
/opt/local # DarwinPorts
|
||||||
|
/opt/csw # Blastwave
|
||||||
|
/opt
|
||||||
|
/usr/freeware
|
||||||
|
)
|
||||||
|
endfunction(OSG_FIND_PATH module header)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# OSG_FIND_LIBRARY
|
||||||
|
#
|
||||||
|
function(OSG_FIND_LIBRARY module library)
|
||||||
|
string(TOUPPER ${module} module_uc)
|
||||||
|
|
||||||
|
find_library(${module_uc}_LIBRARY
|
||||||
|
NAMES ${library}
|
||||||
|
HINTS
|
||||||
|
$ENV{${module_uc}_DIR}
|
||||||
|
$ENV{OSG_DIR}
|
||||||
|
$ENV{OSGDIR}
|
||||||
|
$ENV{OSG_ROOT}
|
||||||
|
PATH_SUFFIXES lib64 lib
|
||||||
|
PATHS
|
||||||
|
/sw # Fink
|
||||||
|
/opt/local # DarwinPorts
|
||||||
|
/opt/csw # Blastwave
|
||||||
|
/opt
|
||||||
|
/usr/freeware
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(${module_uc}_LIBRARY_DEBUG
|
||||||
|
NAMES ${library}d
|
||||||
|
HINTS
|
||||||
|
$ENV{${module_uc}_DIR}
|
||||||
|
$ENV{OSG_DIR}
|
||||||
|
$ENV{OSGDIR}
|
||||||
|
$ENV{OSG_ROOT}
|
||||||
|
PATH_SUFFIXES lib64 lib
|
||||||
|
PATHS
|
||||||
|
/sw # Fink
|
||||||
|
/opt/local # DarwinPorts
|
||||||
|
/opt/csw # Blastwave
|
||||||
|
/opt
|
||||||
|
/usr/freeware
|
||||||
|
)
|
||||||
|
|
||||||
|
if(NOT ${module_uc}_LIBRARY_DEBUG)
|
||||||
|
# They don't have a debug library
|
||||||
|
set(${module_uc}_LIBRARY_DEBUG ${${module_uc}_LIBRARY} PARENT_SCOPE)
|
||||||
|
set(${module_uc}_LIBRARIES ${${module_uc}_LIBRARY} PARENT_SCOPE)
|
||||||
|
else()
|
||||||
|
# They really have a FOO_LIBRARY_DEBUG
|
||||||
|
set(${module_uc}_LIBRARIES
|
||||||
|
optimized ${${module_uc}_LIBRARY}
|
||||||
|
debug ${${module_uc}_LIBRARY_DEBUG}
|
||||||
|
PARENT_SCOPE
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endfunction(OSG_FIND_LIBRARY module library)
|
||||||
|
|
||||||
|
#
|
||||||
|
# OSG_MARK_AS_ADVANCED
|
||||||
|
# Just a convenience function for calling MARK_AS_ADVANCED
|
||||||
|
#
|
||||||
|
function(OSG_MARK_AS_ADVANCED _module)
|
||||||
|
string(TOUPPER ${_module} _module_UC)
|
||||||
|
mark_as_advanced(${_module_UC}_INCLUDE_DIR)
|
||||||
|
mark_as_advanced(${_module_UC}_LIBRARY)
|
||||||
|
mark_as_advanced(${_module_UC}_LIBRARY_DEBUG)
|
||||||
|
endfunction()
|
@ -0,0 +1,231 @@
|
|||||||
|
# FortranCInterface.cmake
|
||||||
|
#
|
||||||
|
# This file defines the function create_fortran_c_interface.
|
||||||
|
# this function is used to create a configured header file
|
||||||
|
# that contains a mapping from C to a Fortran function using
|
||||||
|
# the correct name mangling scheme as defined by the current
|
||||||
|
# fortran compiler.
|
||||||
|
#
|
||||||
|
# The function tages a list of functions and the name of
|
||||||
|
# a header file to configure.
|
||||||
|
#
|
||||||
|
# This file also defines some helper functions that are used
|
||||||
|
# to detect the fortran name mangling scheme used by the
|
||||||
|
# current Fortran compiler.
|
||||||
|
# test_fortran_mangling - test a single fortran mangling
|
||||||
|
# discover_fortran_mangling - loop over all combos of fortran
|
||||||
|
# name mangling and call test_fortran_mangling until one of them
|
||||||
|
# works.
|
||||||
|
# discover_fortran_module_mangling - try different types of
|
||||||
|
# fortran modle name mangling to find one that works
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# this function tests a single fortran mangling.
|
||||||
|
# CODE - test code to try should define a subroutine called "sub"
|
||||||
|
# PREFIX - string to put in front of sub
|
||||||
|
# POSTFIX - string to put after sub
|
||||||
|
# ISUPPER - if TRUE then sub will be called as SUB
|
||||||
|
# DOC - string used in status checking Fortran ${DOC} linkage
|
||||||
|
# SUB - the name of the SUB to call
|
||||||
|
# RESULT place to store result TRUE if this linkage works, FALSE
|
||||||
|
# if not.
|
||||||
|
#
|
||||||
|
function(test_fortran_mangling CODE PREFIX ISUPPER POSTFIX DOC SUB RESULT)
|
||||||
|
if(ISUPPER)
|
||||||
|
string(TOUPPER "${SUB}" sub)
|
||||||
|
else(ISUPPER)
|
||||||
|
string(TOLOWER "${SUB}" sub)
|
||||||
|
endif(ISUPPER)
|
||||||
|
set(FUNCTION "${PREFIX}${sub}${POSTFIX}")
|
||||||
|
# create a fortran file with sub called sub
|
||||||
|
#
|
||||||
|
set(TMP_DIR
|
||||||
|
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckFortranLink")
|
||||||
|
file(REMOVE_RECURSE "${TMP_DIR}")
|
||||||
|
file(WRITE "${TMP_DIR}/test.f" "${CODE}" )
|
||||||
|
message(STATUS "checking Fortran ${DOC} linkage: ${FUNCTION}")
|
||||||
|
file(WRITE "${TMP_DIR}/ctof.c"
|
||||||
|
"
|
||||||
|
extern ${FUNCTION}();
|
||||||
|
int main() { ${FUNCTION}(); return 0;}
|
||||||
|
"
|
||||||
|
)
|
||||||
|
file(WRITE "${TMP_DIR}/CMakeLists.txt"
|
||||||
|
"
|
||||||
|
project(testf C Fortran)
|
||||||
|
add_library(flib test.f)
|
||||||
|
add_executable(ctof ctof.c)
|
||||||
|
target_link_libraries(ctof flib)
|
||||||
|
"
|
||||||
|
)
|
||||||
|
set(FORTRAN_NAME_MANGLE_TEST FALSE)
|
||||||
|
try_compile(FORTRAN_NAME_MANGLE_TEST "${TMP_DIR}" "${TMP_DIR}"
|
||||||
|
testf
|
||||||
|
OUTPUT_VARIABLE output)
|
||||||
|
if(FORTRAN_NAME_MANGLE_TEST)
|
||||||
|
set(${RESULT} TRUE PARENT_SCOPE)
|
||||||
|
else()
|
||||||
|
set(${RESULT} FALSE PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endfunction(test_fortran_mangling)
|
||||||
|
|
||||||
|
# this function discovers the name mangling scheme used
|
||||||
|
# for functions in a fortran module.
|
||||||
|
function(discover_fortran_module_mangling prefix suffix found)
|
||||||
|
set(CODE
|
||||||
|
"
|
||||||
|
module test_interface
|
||||||
|
interface dummy
|
||||||
|
module procedure sub
|
||||||
|
end interface
|
||||||
|
contains
|
||||||
|
subroutine sub
|
||||||
|
end subroutine
|
||||||
|
end module test_interface
|
||||||
|
")
|
||||||
|
set(worked FALSE)
|
||||||
|
foreach(interface
|
||||||
|
"test_interface$"
|
||||||
|
"TEST_INTERFACE_mp_"
|
||||||
|
"_test_interface__"
|
||||||
|
"__test_interface__"
|
||||||
|
"__test_interface_NMOD_"
|
||||||
|
"__test_interface_MOD_")
|
||||||
|
test_fortran_mangling("${CODE}" "${interface}"
|
||||||
|
${FORTRAN_C_MANGLING_UPPERCASE} "" "module" "sub" worked)
|
||||||
|
if(worked)
|
||||||
|
# if this is the upper case module match then
|
||||||
|
# lower case it for the extraction of pre and post strings
|
||||||
|
if("${interface}" MATCHES "TEST_INTERFACE")
|
||||||
|
string(TOLOWER "${interface}" interface)
|
||||||
|
endif()
|
||||||
|
string(REGEX REPLACE "(.*)test_interface(.*)" "\\1" pre "${interface}")
|
||||||
|
string(REGEX REPLACE "(.*)test_interface(.*)" "\\2" post "${interface}")
|
||||||
|
set(${prefix} "${pre}" PARENT_SCOPE)
|
||||||
|
set(${suffix} "${post}" PARENT_SCOPE)
|
||||||
|
set(${found} TRUE PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif(worked)
|
||||||
|
endforeach(interface)
|
||||||
|
if(NOT worked)
|
||||||
|
message(STATUS "Failed to find C binding to Fortran module functions.")
|
||||||
|
set(${prefix} "BROKEN_C_FORTRAN_MODULE_BINDING" PARENT_SCOPE)
|
||||||
|
set(${suffix} "BROKEN_C_FORTRAN_MODULE_BINDING" PARENT_SCOPE)
|
||||||
|
set(${found} FALSE PARENT_SCOPE)
|
||||||
|
endif(NOT worked)
|
||||||
|
endfunction(discover_fortran_module_mangling)
|
||||||
|
|
||||||
|
|
||||||
|
function(discover_fortran_mangling prefix isupper suffix extra_under_score
|
||||||
|
found )
|
||||||
|
set(CODE
|
||||||
|
"
|
||||||
|
subroutine sub
|
||||||
|
end subroutine sub
|
||||||
|
")
|
||||||
|
foreach(post "_" "")
|
||||||
|
foreach(isup FALSE TRUE)
|
||||||
|
foreach(pre "" "_" "__")
|
||||||
|
set(worked FALSE)
|
||||||
|
test_fortran_mangling("${CODE}" "${pre}" ${isup}
|
||||||
|
"${post}" "function" sub worked )
|
||||||
|
if(worked)
|
||||||
|
message(STATUS "found Fortran function linkage")
|
||||||
|
set(${isupper} "${isup}" PARENT_SCOPE)
|
||||||
|
set(${prefix} "${pre}" PARENT_SCOPE)
|
||||||
|
set(${suffix} "${post}" PARENT_SCOPE)
|
||||||
|
set(${found} TRUE PARENT_SCOPE)
|
||||||
|
set(CODE
|
||||||
|
"
|
||||||
|
subroutine my_sub
|
||||||
|
end subroutine my_sub
|
||||||
|
")
|
||||||
|
set(worked FALSE)
|
||||||
|
test_fortran_mangling("${CODE}" "${pre}" ${isup}
|
||||||
|
"${post}" "function with _ " my_sub worked )
|
||||||
|
if(worked)
|
||||||
|
set(${extra_under_score} FALSE PARENT_SCOPE)
|
||||||
|
else(worked)
|
||||||
|
test_fortran_mangling("${CODE}" "${pre}" ${isup}
|
||||||
|
"${post}_" "function with _ " my_sub worked )
|
||||||
|
if(worked)
|
||||||
|
set(${extra_under_score} TRUE PARENT_SCOPE)
|
||||||
|
endif(worked)
|
||||||
|
endif(worked)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endforeach()
|
||||||
|
endforeach()
|
||||||
|
set(${found} FALSE PARENT_SCOPE)
|
||||||
|
endfunction(discover_fortran_mangling)
|
||||||
|
|
||||||
|
function(create_fortran_c_interface NAMESPACE FUNCTIONS HEADER)
|
||||||
|
if(NOT FORTRAN_C_MANGLING_FOUND)
|
||||||
|
# find regular fortran function mangling
|
||||||
|
discover_fortran_mangling(prefix isupper suffix extra_under found)
|
||||||
|
if(NOT found)
|
||||||
|
message(SEND_ERROR "Could not find fortran c name mangling.")
|
||||||
|
return()
|
||||||
|
endif(NOT found)
|
||||||
|
# find fortran module function mangling
|
||||||
|
set(FORTRAN_C_PREFIX "${prefix}" CACHE INTERNAL
|
||||||
|
"PREFIX for Fortran to c name mangling")
|
||||||
|
set(FORTRAN_C_SUFFIX "${suffix}" CACHE INTERNAL
|
||||||
|
"SUFFIX for Fortran to c name mangling")
|
||||||
|
set(FORTRAN_C_MANGLING_UPPERCASE ${isupper} CACHE INTERNAL
|
||||||
|
"Was fortran to c mangling found" )
|
||||||
|
set(FORTRAN_C_MANGLING_EXTRA_UNDERSCORE ${extra_under} CACHE INTERNAL
|
||||||
|
"If a function has a _ in the name does the compiler append an extra _" )
|
||||||
|
set(FORTRAN_C_MANGLING_FOUND TRUE CACHE INTERNAL
|
||||||
|
"Was fortran to c mangling found" )
|
||||||
|
set(prefix )
|
||||||
|
set(suffix )
|
||||||
|
set(found FALSE)
|
||||||
|
# only try this if the compiler is F90 compatible
|
||||||
|
if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
|
||||||
|
discover_fortran_module_mangling(prefix suffix found)
|
||||||
|
endif(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
|
||||||
|
if(found)
|
||||||
|
message(STATUS "found Fortran module linkage")
|
||||||
|
else(found)
|
||||||
|
message(STATUS "Failed to find Fortran module linkage")
|
||||||
|
endif(found)
|
||||||
|
set(FORTRAN_C_MODULE_PREFIX "${prefix}" CACHE INTERNAL
|
||||||
|
"PREFIX for Fortran to c name mangling")
|
||||||
|
set(FORTRAN_C_MODULE_SUFFIX "${suffix}" CACHE INTERNAL
|
||||||
|
"SUFFIX for Fortran to c name mangling")
|
||||||
|
set(FORTRAN_C_MODULE_MANGLING_FOUND ${found} CACHE INTERNAL
|
||||||
|
"Was for Fortran to c name mangling found for modules")
|
||||||
|
endif(NOT FORTRAN_C_MANGLING_FOUND)
|
||||||
|
foreach(f ${${FUNCTIONS}})
|
||||||
|
if(FORTRAN_C_MANGLING_UPPERCASE)
|
||||||
|
string(TOUPPER "${f}" fcase)
|
||||||
|
else()
|
||||||
|
string(TOLOWER "${f}" fcase)
|
||||||
|
endif()
|
||||||
|
if("${f}" MATCHES ":")
|
||||||
|
string(REGEX REPLACE "(.*):(.*)" "\\1" module "${f}")
|
||||||
|
string(REGEX REPLACE "(.*):(.*)" "\\2" function "${f}")
|
||||||
|
string(REGEX REPLACE "(.*):(.*)" "\\1" module_case "${fcase}")
|
||||||
|
string(REGEX REPLACE "(.*):(.*)" "\\2" function_case "${fcase}")
|
||||||
|
set(HEADER_CONTENT "${HEADER_CONTENT}
|
||||||
|
#define ${NAMESPACE}${module}_${function} ${FORTRAN_C_MODULE_PREFIX}${module_case}${FORTRAN_C_MODULE_SUFFIX}${function_case}
|
||||||
|
")
|
||||||
|
else("${f}" MATCHES ":")
|
||||||
|
set(function "${FORTRAN_C_PREFIX}${fcase}${FORTRAN_C_SUFFIX}")
|
||||||
|
if("${f}" MATCHES "_" AND FORTRAN_C_MANGLING_EXTRA_UNDERSCORE)
|
||||||
|
set(function "${function}_")
|
||||||
|
endif("${f}" MATCHES "_" AND FORTRAN_C_MANGLING_EXTRA_UNDERSCORE)
|
||||||
|
set(HEADER_CONTENT "${HEADER_CONTENT}
|
||||||
|
#define ${NAMESPACE}${f} ${function}
|
||||||
|
")
|
||||||
|
endif("${f}" MATCHES ":")
|
||||||
|
endforeach(f)
|
||||||
|
configure_file(
|
||||||
|
"${CMAKE_ROOT}/Modules/FortranCInterface.h.in"
|
||||||
|
${HEADER} @ONLY)
|
||||||
|
message(STATUS "created ${HEADER}")
|
||||||
|
endfunction()
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
/* This file is automatically generated by CMake, DO NOT EDIT.
|
||||||
|
It contains a mapping from Fortran functions so they can
|
||||||
|
be called from C or C++. */
|
||||||
|
|
||||||
|
|
||||||
|
@HEADER_CONTENT@
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
|||||||
|
SET(BEOS 1)
|
||||||
|
|
||||||
|
# GCC is the default compiler on Haiku.
|
||||||
|
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
||||||
|
|
||||||
|
SET(CMAKE_DL_LIBS root be)
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-nostart")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-Wl,-soname,")
|
||||||
|
|
||||||
|
INCLUDE(Platform/UnixPaths)
|
||||||
|
LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH /boot/common)
|
||||||
|
LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH /boot/common/include)
|
||||||
|
LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /boot/common/lib)
|
||||||
|
LIST(APPEND CMAKE_SYSTEM_PROGRAM_PATH /boot/common/bin)
|
||||||
|
LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES /boot/common/lib)
|
||||||
|
LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH /boot/develop/headers/3rdparty)
|
||||||
|
LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /boot/develop/lib/x86)
|
@ -1,2 +1,3 @@
|
|||||||
SET(CMAKE_DL_LIBS "")
|
SET(CMAKE_DL_LIBS "")
|
||||||
|
SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_OPENBSD_VERSIONING 1)
|
||||||
INCLUDE(Platform/UnixPaths)
|
INCLUDE(Platform/UnixPaths)
|
||||||
|
@ -1,2 +1,5 @@
|
|||||||
SET(CMAKE_Fortran_MODDIR_FLAG "-moddir=")
|
set(CMAKE_Fortran_MODDIR_FLAG "-moddir=")
|
||||||
SET(CMAKE_Fortran_MODPATH_FLAG "-M")
|
set(CMAKE_Fortran_MODPATH_FLAG "-M")
|
||||||
|
set(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG "-R")
|
||||||
|
set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-KPIC")
|
||||||
|
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
echo 'Starting the squish server...'
|
||||||
|
start %1
|
||||||
|
|
||||||
|
echo 'Running the test case...'
|
||||||
|
%2 --testcase %3 --wrapper %4 --aut %5
|
||||||
|
set result=%ERRORLEVEL%
|
||||||
|
|
||||||
|
echo 'Stopping the squish server...'
|
||||||
|
%1 --stop
|
||||||
|
|
||||||
|
exit \b %result%
|
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "Starting the squish server...$1 --daemon"
|
||||||
|
$1 --daemon
|
||||||
|
|
||||||
|
echo "Running the test case...$2 --testcase $3 --wrapper $4 --aut $5"
|
||||||
|
$2 --testcase $3 --wrapper $4 --aut $5
|
||||||
|
returnValue=$?
|
||||||
|
|
||||||
|
echo "Stopping the squish server...$1 --stop"
|
||||||
|
$1 --stop
|
||||||
|
|
||||||
|
exit $returnValue
|
@ -0,0 +1,59 @@
|
|||||||
|
#
|
||||||
|
# This script launches a GUI test using Squish. You should not call
|
||||||
|
# the script directly; instead, you should acces it via the
|
||||||
|
# SQUISH_ADD_TEST macro that is defined in FindSquish.cmake.
|
||||||
|
#
|
||||||
|
# This script starts the Squish server, launches the test on the
|
||||||
|
# client, and finally stops the squish server. If any of these steps
|
||||||
|
# fail (including if the tests do not pass) then a fatal error is
|
||||||
|
# raised.
|
||||||
|
#
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
|
||||||
|
|
||||||
|
# print out the variable that we are using
|
||||||
|
message(STATUS "squish_aut='${squish_aut}'")
|
||||||
|
|
||||||
|
message(STATUS "squish_server_executable='${squish_server_executable}'")
|
||||||
|
message(STATUS "squish_client_executable='${squish_client_executable}'")
|
||||||
|
message(STATUS "squish_libqtdir ='${squish_libqtdir}'")
|
||||||
|
message(STATUS "squish_test_case='${squish_test_case}'")
|
||||||
|
message(STATUS "squish_wrapper='${squish_wrapper}'")
|
||||||
|
message(STATUS "squish_env_vars='${squish_env_vars}'")
|
||||||
|
|
||||||
|
# parse enviornment variables
|
||||||
|
foreach(i ${squish_env_vars})
|
||||||
|
message(STATUS "parsing env var key/value pair ${i}")
|
||||||
|
string(REGEX MATCH "([^=]*)=(.*)" squish_env_name ${i})
|
||||||
|
message(STATUS "key=${CMAKE_MATCH_1}")
|
||||||
|
message(STATUS "value=${CMAKE_MATCH_2}")
|
||||||
|
set ( ENV{${CMAKE_MATCH_1}} ${CMAKE_MATCH_2} )
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
if (QT4_INSTALLED)
|
||||||
|
# record qt lib directory
|
||||||
|
set ( ENV{${SQUISH_LIBQTDIR}} ${squish_libqtdir} )
|
||||||
|
endif (QT4_INSTALLED)
|
||||||
|
|
||||||
|
# run the test
|
||||||
|
if (WIN32)
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${CMAKE_ROOT}/Modules/SquishRunTestCase.bat ${squish_server_executable} ${squish_client_executable} ${squish_test_case} ${squish_wrapper} ${squish_aut}
|
||||||
|
RESULT_VARIABLE test_rv
|
||||||
|
)
|
||||||
|
endif (WIN32)
|
||||||
|
|
||||||
|
if (UNIX)
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${CMAKE_ROOT}/Modules/SquishRunTestCase.sh ${squish_server_executable} ${squish_client_executable} ${squish_test_case} ${squish_wrapper} ${squish_aut}
|
||||||
|
RESULT_VARIABLE test_rv
|
||||||
|
)
|
||||||
|
endif (UNIX)
|
||||||
|
|
||||||
|
# check for an error with running the test
|
||||||
|
if(NOT "${test_rv}" STREQUAL "0")
|
||||||
|
message(FATAL_ERROR "Error running Squish test")
|
||||||
|
endif(NOT "${test_rv}" STREQUAL "0")
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,253 @@
|
|||||||
|
/*=========================================================================
|
||||||
|
|
||||||
|
Program: CMake - Cross-Platform Makefile Generator
|
||||||
|
Module: $RCSfile: cmCPackDragNDropGenerator.cxx,v $
|
||||||
|
Language: C++
|
||||||
|
Date: $Date: 2009-02-05 03:04:12 $
|
||||||
|
Version: $Revision: 1.1.2.2 $
|
||||||
|
|
||||||
|
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
|
||||||
|
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
||||||
|
|
||||||
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
||||||
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. See the above copyright notices for more information.
|
||||||
|
|
||||||
|
=========================================================================*/
|
||||||
|
|
||||||
|
#include "cmCPackDragNDropGenerator.h"
|
||||||
|
#include "cmCPackLog.h"
|
||||||
|
#include "cmSystemTools.h"
|
||||||
|
|
||||||
|
#include <cmsys/RegularExpression.hxx>
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
cmCPackDragNDropGenerator::cmCPackDragNDropGenerator()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
cmCPackDragNDropGenerator::~cmCPackDragNDropGenerator()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
int cmCPackDragNDropGenerator::InitializeInternal()
|
||||||
|
{
|
||||||
|
const std::string hdiutil_path = cmSystemTools::FindProgram("hdiutil",
|
||||||
|
std::vector<std::string>(), false);
|
||||||
|
if(hdiutil_path.empty())
|
||||||
|
{
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
|
"Cannot locate hdiutil command"
|
||||||
|
<< std::endl);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
this->SetOptionIfNotSet("CPACK_COMMAND_HDIUTIL", hdiutil_path.c_str());
|
||||||
|
|
||||||
|
const std::string setfile_path = cmSystemTools::FindProgram("SetFile",
|
||||||
|
std::vector<std::string>(1, "/Developer/Tools"), false);
|
||||||
|
if(setfile_path.empty())
|
||||||
|
{
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
|
"Cannot locate SetFile command"
|
||||||
|
<< std::endl);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
this->SetOptionIfNotSet("CPACK_COMMAND_SETFILE", setfile_path.c_str());
|
||||||
|
|
||||||
|
return this->Superclass::InitializeInternal();
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
const char* cmCPackDragNDropGenerator::GetOutputExtension()
|
||||||
|
{
|
||||||
|
return ".dmg";
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
int cmCPackDragNDropGenerator::CompressFiles(const char* outFileName,
|
||||||
|
const char* toplevel, const std::vector<std::string>& files)
|
||||||
|
{
|
||||||
|
(void) files;
|
||||||
|
|
||||||
|
// Get optional arguments ...
|
||||||
|
const std::string cpack_package_icon = this->GetOption("CPACK_PACKAGE_ICON")
|
||||||
|
? this->GetOption("CPACK_PACKAGE_ICON") : "";
|
||||||
|
|
||||||
|
// The staging directory contains everything that will end-up inside the
|
||||||
|
// final disk image ...
|
||||||
|
cmOStringStream staging;
|
||||||
|
staging << toplevel;
|
||||||
|
|
||||||
|
// Add a symlink to /Applications so users can drag-and-drop the bundle
|
||||||
|
// into it
|
||||||
|
cmOStringStream application_link;
|
||||||
|
application_link << staging.str() << "/Applications";
|
||||||
|
cmSystemTools::CreateSymlink("/Applications",
|
||||||
|
application_link.str().c_str());
|
||||||
|
|
||||||
|
// Optionally add a custom volume icon ...
|
||||||
|
if(!cpack_package_icon.empty())
|
||||||
|
{
|
||||||
|
cmOStringStream package_icon_source;
|
||||||
|
package_icon_source << cpack_package_icon;
|
||||||
|
|
||||||
|
cmOStringStream package_icon_destination;
|
||||||
|
package_icon_destination << staging.str() << "/.VolumeIcon.icns";
|
||||||
|
|
||||||
|
if(!this->CopyFile(package_icon_source, package_icon_destination))
|
||||||
|
{
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
|
"Error copying disk volume icon. "
|
||||||
|
"Check the value of CPACK_PACKAGE_ICON."
|
||||||
|
<< std::endl);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create a temporary read-write disk image ...
|
||||||
|
cmOStringStream temp_image;
|
||||||
|
temp_image << this->GetOption("CPACK_TOPLEVEL_DIRECTORY") << "/temp.dmg";
|
||||||
|
|
||||||
|
cmOStringStream temp_image_command;
|
||||||
|
temp_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
|
||||||
|
temp_image_command << " create";
|
||||||
|
temp_image_command << " -ov";
|
||||||
|
temp_image_command << " -srcfolder \"" << staging.str() << "\"";
|
||||||
|
temp_image_command << " -volname \""
|
||||||
|
<< this->GetOption("CPACK_PACKAGE_FILE_NAME") << "\"";
|
||||||
|
temp_image_command << " -format UDRW";
|
||||||
|
temp_image_command << " \"" << temp_image.str() << "\"";
|
||||||
|
|
||||||
|
if(!this->RunCommand(temp_image_command))
|
||||||
|
{
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
|
"Error generating temporary disk image."
|
||||||
|
<< std::endl);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Optionally set the custom icon flag for the image ...
|
||||||
|
if(!cpack_package_icon.empty())
|
||||||
|
{
|
||||||
|
cmOStringStream temp_mount;
|
||||||
|
|
||||||
|
cmOStringStream attach_command;
|
||||||
|
attach_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
|
||||||
|
attach_command << " attach";
|
||||||
|
attach_command << " \"" << temp_image.str() << "\"";
|
||||||
|
|
||||||
|
std::string attach_output;
|
||||||
|
if(!this->RunCommand(attach_command, &attach_output))
|
||||||
|
{
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
|
"Error attaching temporary disk image."
|
||||||
|
<< std::endl);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
cmsys::RegularExpression mountpoint_regex(".*(/Volumes/[^\n]+)\n.*");
|
||||||
|
mountpoint_regex.find(attach_output.c_str());
|
||||||
|
temp_mount << mountpoint_regex.match(1);
|
||||||
|
|
||||||
|
cmOStringStream setfile_command;
|
||||||
|
setfile_command << this->GetOption("CPACK_COMMAND_SETFILE");
|
||||||
|
setfile_command << " -a C";
|
||||||
|
setfile_command << " \"" << temp_mount.str() << "\"";
|
||||||
|
|
||||||
|
if(!this->RunCommand(setfile_command))
|
||||||
|
{
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
|
"Error assigning custom icon to temporary disk image."
|
||||||
|
<< std::endl);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
cmOStringStream detach_command;
|
||||||
|
detach_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
|
||||||
|
detach_command << " detach";
|
||||||
|
detach_command << " \"" << temp_mount.str() << "\"";
|
||||||
|
|
||||||
|
if(!this->RunCommand(detach_command))
|
||||||
|
{
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
|
"Error detaching temporary disk image."
|
||||||
|
<< std::endl);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the final compressed read-only disk image ...
|
||||||
|
cmOStringStream final_image_command;
|
||||||
|
final_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
|
||||||
|
final_image_command << " convert \"" << temp_image.str() << "\"";
|
||||||
|
final_image_command << " -format UDZO";
|
||||||
|
final_image_command << " -imagekey";
|
||||||
|
final_image_command << " zlib-level=9";
|
||||||
|
final_image_command << " -o \"" << outFileName << "\"";
|
||||||
|
|
||||||
|
if(!this->RunCommand(final_image_command))
|
||||||
|
{
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
|
"Error compressing disk image."
|
||||||
|
<< std::endl);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
bool cmCPackDragNDropGenerator::CopyFile(cmOStringStream& source,
|
||||||
|
cmOStringStream& target)
|
||||||
|
{
|
||||||
|
if(!cmSystemTools::CopyFileIfDifferent(
|
||||||
|
source.str().c_str(),
|
||||||
|
target.str().c_str()))
|
||||||
|
{
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
|
"Error copying "
|
||||||
|
<< source.str()
|
||||||
|
<< " to "
|
||||||
|
<< target.str()
|
||||||
|
<< std::endl);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
bool cmCPackDragNDropGenerator::RunCommand(cmOStringStream& command,
|
||||||
|
std::string* output)
|
||||||
|
{
|
||||||
|
int exit_code = 1;
|
||||||
|
|
||||||
|
bool result = cmSystemTools::RunSingleCommand(
|
||||||
|
command.str().c_str(),
|
||||||
|
output,
|
||||||
|
&exit_code,
|
||||||
|
0,
|
||||||
|
this->GeneratorVerbose,
|
||||||
|
0);
|
||||||
|
|
||||||
|
if(!result || exit_code)
|
||||||
|
{
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
|
"Error executing: "
|
||||||
|
<< command.str()
|
||||||
|
<< std::endl);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
/*=========================================================================
|
||||||
|
|
||||||
|
Program: CMake - Cross-Platform Makefile Generator
|
||||||
|
Module: $RCSfile: cmCPackDragNDropGenerator.h,v $
|
||||||
|
Language: C++
|
||||||
|
Date: $Date: 2009-02-05 03:04:18 $
|
||||||
|
Version: $Revision: 1.1.2.2 $
|
||||||
|
|
||||||
|
Copyright (c) 2002 Kitware, Inc. All rights reserved.
|
||||||
|
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
||||||
|
|
||||||
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
||||||
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. See the above copyright notices for more information.
|
||||||
|
|
||||||
|
=========================================================================*/
|
||||||
|
|
||||||
|
#ifndef cmCPackDragNDropGenerator_h
|
||||||
|
#define cmCPackDragNDropGenerator_h
|
||||||
|
|
||||||
|
#include "cmCPackGenerator.h"
|
||||||
|
|
||||||
|
/** \class cmCPackDragNDropGenerator
|
||||||
|
* \brief A generator for OSX drag-n-drop installs
|
||||||
|
*/
|
||||||
|
class cmCPackDragNDropGenerator : public cmCPackGenerator
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
cmCPackTypeMacro(cmCPackDragNDropGenerator, cmCPackGenerator);
|
||||||
|
|
||||||
|
cmCPackDragNDropGenerator();
|
||||||
|
virtual ~cmCPackDragNDropGenerator();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual int InitializeInternal();
|
||||||
|
virtual const char* GetOutputExtension();
|
||||||
|
int CompressFiles(const char* outFileName, const char* toplevel,
|
||||||
|
const std::vector<std::string>& files);
|
||||||
|
|
||||||
|
bool CopyFile(cmOStringStream& source, cmOStringStream& target);
|
||||||
|
bool RunCommand(cmOStringStream& command, std::string* output = 0);
|
||||||
|
|
||||||
|
std::string InstallPrefix;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue