-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first try at making osgWorks found by third party packages the CMake …
…way. git-svn-id: http://osgworks.googlecode.com/svn/trunk@441 c67418bc-a6eb-11de-8ba5-91705c1537ed
- Loading branch information
1 parent
e9971b0
commit 3651250
Showing
7 changed files
with
153 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# - Find a osgWorks installation or build tree. | ||
# The following variables are set if osgWorks is found. If osgWorks is not | ||
# found, osgWorks_FOUND is set to false. | ||
# osgWorks_FOUND - Set to true when osgWorks is found. | ||
# osgWorks_USE_FILE - CMake file to use osgWorks. | ||
# osgWorks_MAJOR_VERSION - The osgWorks major version number. | ||
# osgWorks_MINOR_VERSION - The osgWorks minor version number | ||
# (odd non-release). | ||
# osgWorks_BUILD_VERSION - The osgWorks patch level | ||
# (meaningless for odd minor). | ||
# osgWorks_INCLUDE_DIRS - Include directories for osgWorks | ||
# osgWorks_LIBRARY_DIRS - Link directories for osgWorks libraries | ||
|
||
# The following cache entries must be set by the user to locate osgWorks: | ||
# osgWorks_DIR - The directory containing osgWorksConfig.cmake. | ||
# This is either the root of the build tree, | ||
# or the lib directory. This is the | ||
# only cache entry. | ||
|
||
|
||
# Assume not found. | ||
SET(osgWorks_FOUND 0) | ||
|
||
# Construct consitent error messages for use below. | ||
SET(osgWorks_DIR_DESCRIPTION "directory containing osgWorksConfig.cmake. This is either the root of the build tree, or PREFIX/lib for an installation.") | ||
SET(osgWorks_DIR_MESSAGE "osgWorks not found. Set the osgWorks_DIR cmake cache entry to the ${osgWorks_DIR_DESCRIPTION}") | ||
|
||
# Use the Config mode of the find_package() command to find osgWorksConfig. | ||
# If this succeeds (possibly because osgWorks_DIR is already set), the | ||
# command will have already loaded osgWorksConfig.cmake and set osgWorks_FOUND. | ||
IF(NOT osgWorks_FOUND) | ||
FIND_PACKAGE(osgWorks QUIET NO_MODULE) | ||
ENDIF() | ||
|
||
#----------------------------------------------------------------------------- | ||
IF(NOT osgWorks_FOUND) | ||
# osgWorks not found, explain to the user how to specify its location. | ||
IF(osgWorks_FIND_REQUIRED) | ||
MESSAGE(FATAL_ERROR ${osgWorks_DIR_MESSAGE}) | ||
ELSE(osgWorks_FIND_REQUIRED) | ||
IF(NOT osgWorks_FIND_QUIETLY) | ||
MESSAGE(STATUS ${osgWorks_DIR_MESSAGE}) | ||
ENDIF(NOT osgWorks_FIND_QUIETLY) | ||
ENDIF(osgWorks_FIND_REQUIRED) | ||
ENDIF(osgWorks_FOUND) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# | ||
# This module is provided as osgWorks_USE_FILE by osgWorksConfig.cmake. It can | ||
# be INCLUDEd in a project to load the needed compiler and linker | ||
# settings to use osgWorks. | ||
# | ||
|
||
IF(NOT osgWorks_USE_FILE_INCLUDED) | ||
SET(osgWorks_USE_FILE_INCLUDED 1) | ||
|
||
# Update CMAKE_MODULE_PATH so includes work. | ||
#SET (CMAKE_MODULE_PATH | ||
# ${CMAKE_MODULE_PATH} | ||
# ${VTK_CMAKE_DIR}) | ||
|
||
# Add compiler flags needed to use osgWorks. | ||
#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VTK_REQUIRED_C_FLAGS}") | ||
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VTK_REQUIRED_CXX_FLAGS}") | ||
#SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${VTK_REQUIRED_EXE_LINKER_FLAGS}") | ||
#SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${VTK_REQUIRED_SHARED_LINKER_FLAGS}") | ||
#SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${VTK_REQUIRED_MODULE_LINKER_FLAGS}") | ||
|
||
# Add include directories needed to use osgWorks. | ||
INCLUDE_DIRECTORIES(${OSGWORKS_INCLUDE_DIRS}) | ||
|
||
ENDIF(NOT osgWorks_USE_FILE_INCLUDED) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
set(OSGWORKS_INCLUDE_DIRS | ||
"@PROJECT_SOURCE_DIR@/include" | ||
"@PROJECT_BINARY_DIR@") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# - Config file for the osgWorks package | ||
# It defines the following variables | ||
# OSGWORKS_INCLUDE_DIRS - include directories for FooBar | ||
# OSGWORKS_LIBRARIES - libraries to link against | ||
# OSGWORKS_EXECUTABLE - the bar executable | ||
|
||
@PACKAGE_INIT@ | ||
|
||
# These are IMPORTED targets created by osgWorksLibraryDepends.cmake | ||
set(OSGWORKS_LIBRARIES "osgwTools;osgwQuery;osgwMx" ) | ||
set(OSGWORKS_EXECUTABLE test) | ||
|
||
# Compute paths | ||
# get_filename_component(OSGWORKS_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) | ||
if(EXISTS "${PACKAGE_PREFIX_DIR}/CMakeCache.txt") | ||
# In build tree | ||
include("${PACKAGE_PREFIX_DIR}/lib/osgWorksBuildTreeSettings.cmake") | ||
# Our library dependencies (contains definitions for IMPORTED targets) | ||
include("${PACKAGE_PREFIX_DIR}/lib/osgWorksLibraryDepends.cmake") | ||
else() | ||
set_and_check(OSGWORKS_INCLUDE_DIRS "@PACKAGE_CONF_REL_INCLUDE_DIR@") | ||
# The osgWorks targets file. | ||
if(EXISTS "${PACKAGE_PREFIX_DIR}/lib/osgworks-targets.cmake") | ||
include("${PACKAGE_PREFIX_DIR}/lib/osgworks-targets.cmake") | ||
endif() | ||
endif() | ||
|
||
# The location of the UseosgWorks.cmake file. | ||
set(osgWorks_USE_FILE "${PACKAGE_PREFIX_DIR}/lib/UseosgWorks.cmake") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
set(PACKAGE_VERSION "@OSGWORKS_VERSION@") | ||
|
||
# Check whether the requested PACKAGE_FIND_VERSION is compatible | ||
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") | ||
set(PACKAGE_VERSION_COMPATIBLE FALSE) | ||
else() | ||
set(PACKAGE_VERSION_COMPATIBLE TRUE) | ||
if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") | ||
set(PACKAGE_VERSION_EXACT TRUE) | ||
endif() | ||
endif() |