From Philip Lowman, post 1:
"Here is a collection of changes which should fix issues building the OSG with CMake 2.6.0 (along with some other changes) CMakeLists.txt: * Set CMP0003 to supress warning about linking against -lpthread (which is a non-absolute library location). (CMake 2.6.x fix) * Modified the WIN32_USE_MP and a couple of other Visual Studio specific flags to be in an IF(MSVC) block (minor tweak to reduce exposing this stuff on MinGW builds) * Includes my second set of glu tesselator autodetection changes that you seemed to want but haven't committed yet. src/OpenThreads/pthreads/CMakeLists.txt: * Eliminates warning when compiling on Linux about spaces in link line (CMake 2.6.x fix) CMakeModules/OsgMacroUtils.cmake: * Tweaks to make the macros behave properly under CMake 2.6.0 (doesn't change behavior under CMake 2.4.x) CMakeModules/Find3rdPartyDependencies.cmake: * Adds the NO_DEFAULT_PATH option to all of the search options so that things in C:\Program Files\OpenSceneGraph aren't accidently picked up during configure time and instead only things in the "3rdParty" folder are discovered. (general bugfix) " post 2: "Ok, hold the presses. I just discovered that for some odd reason the osgdb_* plugins under Linux aren't getting put under the osgPlugins-2.5.0 folder. Not exactly sure why this broke, the folder was there, just empty. I'll have to look into it this evening." post 3: "Fixed, was caused by the switch to CMAKE_LIBRARY_OUTPUT_DIRECTORY and some code in osgPlugins/CMakeLists.txt that effectively overrides LIBRARY_OUTPUT_PATH on non-MSVC compilers to dump the plugins in the plugins folder. I tweaked it to override CMAKE_LIBRARY_OUTPUT_DIRECTORY as well. Seems to work fine."
This commit is contained in:
@@ -11,6 +11,11 @@ ELSE(WIN32)
|
||||
ENDIF(APPLE)
|
||||
ENDIF(WIN32)
|
||||
|
||||
# Works around warnings libraries linked against that don't
|
||||
# have absolute paths (e.g. -lpthreads)
|
||||
if(COMMAND cmake_policy)
|
||||
cmake_policy(SET CMP0003 NEW)
|
||||
endif(COMMAND cmake_policy)
|
||||
|
||||
PROJECT(OpenSceneGraph)
|
||||
|
||||
@@ -101,15 +106,19 @@ INCLUDE_DIRECTORIES(
|
||||
|
||||
IF(WIN32)
|
||||
|
||||
# This option is to enable the /MP switch for Visual Studio 2005 and above compilers
|
||||
OPTION(WIN32_USE_MP "Set to ON to build OpenSceneGraph with the /MP option (Visual Studio 2005 and above)." OFF)
|
||||
MARK_AS_ADVANCED(WIN32_USE_MP)
|
||||
IF(WIN32_USE_MP)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||
ENDIF(WIN32_USE_MP)
|
||||
IF(MSVC)
|
||||
# This option is to enable the /MP switch for Visual Studio 2005 and above compilers
|
||||
OPTION(WIN32_USE_MP "Set to ON to build OpenSceneGraph with the /MP option (Visual Studio 2005 and above)." OFF)
|
||||
MARK_AS_ADVANCED(WIN32_USE_MP)
|
||||
IF(WIN32_USE_MP)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||
ENDIF(WIN32_USE_MP)
|
||||
|
||||
# More MSVC specific compilation flags
|
||||
ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS)
|
||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
|
||||
ENDIF(MSVC)
|
||||
|
||||
ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS)
|
||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
|
||||
#needed for net plugin
|
||||
SET (OSG_SOCKET_LIBS wsock32)
|
||||
# Both Cygwin and Msys need -DNOMINMAX ???
|
||||
@@ -345,7 +354,10 @@ ENDIF(UNIX AND NOT WIN32 AND NOT APPLE)
|
||||
IF(NOT DEFINED LIB_POSTFIX)
|
||||
SET(LIB_POSTFIX "")
|
||||
ENDIF(NOT DEFINED LIB_POSTFIX)
|
||||
|
||||
|
||||
# Here we apparantly do some funky stuff with making the bin/ and lib/
|
||||
# folders which is probably needed to work around a very old CMake bug?
|
||||
|
||||
#SET(OUTPUT_BINDIR ${PROJECT_BINARY_DIR}/bin/${CMAKE_SYSTEM_NAME})
|
||||
SET(OUTPUT_BINDIR ${PROJECT_BINARY_DIR}/bin)
|
||||
MAKE_DIRECTORY(${OUTPUT_BINDIR})
|
||||
@@ -353,17 +365,32 @@ IF(MSVC AND NOT MSVC_IDE)
|
||||
MAKE_DIRECTORY(${OUTPUT_BINDIR}/${OSG_PLUGINS})
|
||||
ENDIF(MSVC AND NOT MSVC_IDE)
|
||||
|
||||
SET(EXECUTABLE_OUTPUT_PATH ${OUTPUT_BINDIR})
|
||||
|
||||
#SET(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib/${CMAKE_SYSTEM_NAME})
|
||||
SET(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib)
|
||||
MAKE_DIRECTORY(${OUTPUT_LIBDIR})
|
||||
IF(NOT MSVC)
|
||||
MAKE_DIRECTORY(${OUTPUT_LIBDIR}/${OSG_PLUGINS})
|
||||
ENDIF(NOT MSVC)
|
||||
SET(LIBRARY_OUTPUT_PATH ${OUTPUT_LIBDIR})
|
||||
|
||||
# On CMake 2.4.x use EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH and later
|
||||
# we work around the DLL placement by use of the PREFIX target property hack
|
||||
#
|
||||
# On CMake 2.6.x use the newly minted CMAKE_LIBRARY_OUTPUT_DIRECTORY,
|
||||
# CMAKE_ARCHIVE_OUTPUT_DIRECTORY & CMAKE_RUNTIME_OUTPUT_DIRECTORY
|
||||
|
||||
IF(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 4)
|
||||
# If CMake >= 2.6.0
|
||||
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
|
||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_BINDIR})
|
||||
IF(WIN32)
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_BINDIR})
|
||||
ELSE(WIN32)
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
|
||||
ENDIF(WIN32)
|
||||
ELSE(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 4)
|
||||
SET(EXECUTABLE_OUTPUT_PATH ${OUTPUT_BINDIR})
|
||||
SET(LIBRARY_OUTPUT_PATH ${OUTPUT_LIBDIR})
|
||||
ENDIF(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 4)
|
||||
|
||||
#SET(INSTALL_BINDIR OpenSceneGraph/bin)
|
||||
#SET(INSTALL_INCDIR OpenSceneGraph/include)
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
MACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES SEARCHPATHLIST DEBUGSUFFIX)
|
||||
|
||||
MESSAGE(STATUS "searching ${DEPNAME} -->${INCLUDEFILE}<-->${LIBRARY}<-->${SEARCHPATHLIST}<--")
|
||||
|
||||
MESSAGE(STATUS "searching ${DEPNAME} -->${INCLUDEFILE}<-->${LIBRARY_NAMES}<-->${SEARCHPATHLIST}<--")
|
||||
|
||||
SET(MY_PATH_INCLUDE )
|
||||
SET(MY_PATH_LIB )
|
||||
|
||||
@@ -14,9 +14,10 @@ MACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES SEARCHPATHLIST DEBUGSUFF
|
||||
SET(MY_PATH_INCLUDE ${MY_PATH_INCLUDE} ${MYPATH}/include)
|
||||
SET(MY_PATH_LIB ${MY_PATH_LIB} ${MYPATH}/lib)
|
||||
ENDFOREACH( MYPATH ${SEARCHPATHLIST} )
|
||||
|
||||
|
||||
FIND_PATH("${DEPNAME}_INCLUDE_DIR" ${INCLUDEFILE}
|
||||
${MY_PATH_INCLUDE}
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
MARK_AS_ADVANCED("${DEPNAME}_INCLUDE_DIR")
|
||||
#MESSAGE( " ${DEPNAME}_INCLUDE_DIR --> ${${DEPNAME}_INCLUDE_DIR}<--")
|
||||
@@ -24,6 +25,7 @@ MACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES SEARCHPATHLIST DEBUGSUFF
|
||||
FIND_LIBRARY("${DEPNAME}_LIBRARY"
|
||||
NAMES ${LIBRARY_NAMES}
|
||||
PATHS ${MY_PATH_LIB}
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
SET(LIBRARY_NAMES_DEBUG "")
|
||||
FOREACH(LIBNAME ${LIBRARY_NAMES})
|
||||
@@ -32,6 +34,7 @@ MACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES SEARCHPATHLIST DEBUGSUFF
|
||||
FIND_LIBRARY("${DEPNAME}_LIBRARY_DEBUG"
|
||||
NAMES ${LIBRARY_NAMES_DEBUG}
|
||||
PATHS ${MY_PATH_LIB}
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
MARK_AS_ADVANCED("${DEPNAME}_LIBRARY")
|
||||
#MESSAGE( " ${DEPNAME}_LIBRARY --> ${${DEPNAME}_LIBRARY}<--")
|
||||
|
||||
@@ -21,22 +21,26 @@ MACRO(LINK_WITH_VARIABLES TRGTNAME)
|
||||
ENDMACRO(LINK_WITH_VARIABLES TRGTNAME)
|
||||
|
||||
MACRO(LINK_INTERNAL TRGTNAME)
|
||||
FOREACH(LINKLIB ${ARGN})
|
||||
IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
||||
#when using versioned names, the .dll name differ from .lib name, there is a problem with that:
|
||||
#CMake 2.4.7, at least seem to use PREFIX instead of IMPORT_PREFIX for computing linkage info to use into projects,
|
||||
# so we full path name to specify linkage, this prevent automatic inferencing of dependencies, so we add explicit depemdencies
|
||||
#to library targets used
|
||||
IF(NOT MSVC_IDE)
|
||||
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${OUTPUT_LIBDIR}/${LINKLIB}.lib" debug "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}.lib")
|
||||
ELSE(NOT MSVC_IDE)
|
||||
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${OUTPUT_LIBDIR}/${LINKLIB}" debug "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
|
||||
ENDIF(NOT MSVC_IDE)
|
||||
ADD_DEPENDENCIES(${TRGTNAME} ${LINKLIB})
|
||||
ELSE(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
||||
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${LINKLIB}" debug "${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
|
||||
ENDIF(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
||||
ENDFOREACH(LINKLIB)
|
||||
IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
|
||||
TARGET_LINK_LIBRARIES(${TRGTNAME} ${ARGN})
|
||||
ELSE(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
|
||||
FOREACH(LINKLIB ${ARGN})
|
||||
IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
||||
#when using versioned names, the .dll name differ from .lib name, there is a problem with that:
|
||||
#CMake 2.4.7, at least seem to use PREFIX instead of IMPORT_PREFIX for computing linkage info to use into projects,
|
||||
# so we full path name to specify linkage, this prevent automatic inferencing of dependencies, so we add explicit depemdencies
|
||||
#to library targets used
|
||||
IF(NOT MSVC_IDE)
|
||||
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${OUTPUT_LIBDIR}/${LINKLIB}.lib" debug "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}.lib")
|
||||
ELSE(NOT MSVC_IDE)
|
||||
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${OUTPUT_LIBDIR}/${LINKLIB}" debug "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
|
||||
ENDIF(NOT MSVC_IDE)
|
||||
ADD_DEPENDENCIES(${TRGTNAME} ${LINKLIB})
|
||||
ELSE(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
||||
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${LINKLIB}" debug "${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
|
||||
ENDIF(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
||||
ENDFOREACH(LINKLIB)
|
||||
ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
|
||||
ENDMACRO(LINK_INTERNAL TRGTNAME)
|
||||
|
||||
MACRO(LINK_EXTERNAL TRGTNAME)
|
||||
@@ -118,7 +122,7 @@ ENDMACRO(SETUP_LINK_LIBRARIES)
|
||||
|
||||
MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
||||
|
||||
SET(TARGET_NAME ${PLUGIN_NAME} )
|
||||
SET(TARGET_NAME ${PLUGIN_NAME} )
|
||||
|
||||
#MESSAGE("in -->SETUP_PLUGIN<-- ${TARGET_NAME}-->${TARGET_SRC} <--> ${TARGET_H}<--")
|
||||
|
||||
@@ -131,7 +135,7 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
||||
SET(TARGET_LABEL "${TARGET_DEFAULT_LABEL_PREFIX} ${TARGET_NAME}")
|
||||
ENDIF(NOT TARGET_LABEL)
|
||||
|
||||
# here we use the command to generate the library
|
||||
# here we use the command to generate the library
|
||||
|
||||
IF (DYNAMIC_OPENSCENEGRAPH)
|
||||
ADD_LIBRARY(${TARGET_TARGETNAME} MODULE ${TARGET_SRC} ${TARGET_H})
|
||||
@@ -143,38 +147,53 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
||||
IF(NOT MSVC)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES DEBUG_POSTFIX "")
|
||||
ELSE(NOT MSVC)
|
||||
IF(OSG_MSVC_VERSIONED_DLL)
|
||||
|
||||
IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
|
||||
IF(NOT MSVC_IDE)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "${OSG_PLUGINS}/")
|
||||
ELSE(NOT MSVC_IDE)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../${OSG_PLUGINS}/")
|
||||
ENDIF(NOT MSVC_IDE)
|
||||
ELSE(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
|
||||
IF(OSG_MSVC_VERSIONED_DLL)
|
||||
|
||||
#this is a hack... the build place is set to lib/<debug or release> by LIBARARY_OUTPUT_PATH equal to OUTPUT_LIBDIR
|
||||
#the .lib will be crated in ../ so going straight in lib by the IMPORT_PREFIX property
|
||||
#because we want dll placed in OUTPUT_BINDIR ie the bin folder sibling of lib, we can use ../../bin to go there,
|
||||
#it is hardcoded, we should compute OUTPUT_BINDIR position relative to OUTPUT_LIBDIR ... to be implemented
|
||||
#changing bin to something else breaks this hack
|
||||
#the dll are placed in bin/${OSG_PLUGINS}
|
||||
|
||||
|
||||
IF(NOT MSVC_IDE)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../bin/${OSG_PLUGINS}/")
|
||||
ELSE(NOT MSVC_IDE)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../../bin/${OSG_PLUGINS}/" IMPORT_PREFIX "../")
|
||||
ENDIF(NOT MSVC_IDE)
|
||||
|
||||
ELSE(OSG_MSVC_VERSIONED_DLL)
|
||||
|
||||
#in standard mode (unversioned) the .lib and .dll are placed in lib/<debug or release>/${OSG_PLUGINS}.
|
||||
#here the PREFIX property has been used, the same result would be accomplidhe by prepending ${OSG_PLUGINS}/ to OUTPUT_NAME target property
|
||||
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "${OSG_PLUGINS}/")
|
||||
ENDIF(OSG_MSVC_VERSIONED_DLL)
|
||||
ELSE(OSG_MSVC_VERSIONED_DLL)
|
||||
|
||||
#in standard mode (unversioned) the .lib and .dll are placed in lib/<debug or release>/${OSG_PLUGINS}.
|
||||
#here the PREFIX property has been used, the same result would be accomplidhe by prepending ${OSG_PLUGINS}/ to OUTPUT_NAME target property
|
||||
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "${OSG_PLUGINS}/")
|
||||
ENDIF(OSG_MSVC_VERSIONED_DLL)
|
||||
ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
|
||||
ENDIF(NOT MSVC)
|
||||
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
|
||||
|
||||
SETUP_LINK_LIBRARIES()
|
||||
|
||||
#the installation path are differentiated for win32 that install in bib versus other architecture that install in lib${LIB_POSTFIX}/${OSG_PLUGINS}
|
||||
IF(WIN32)
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib/${OSG_PLUGINS} LIBRARY DESTINATION bin/${OSG_PLUGINS} )
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME}
|
||||
RUNTIME DESTINATION bin
|
||||
ARCHIVE DESTINATION lib/${OSG_PLUGINS}
|
||||
LIBRARY DESTINATION bin/${OSG_PLUGINS} )
|
||||
ELSE(WIN32)
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} )
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME}
|
||||
RUNTIME DESTINATION bin
|
||||
ARCHIVE DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS}
|
||||
LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} )
|
||||
ENDIF(WIN32)
|
||||
ENDMACRO(SETUP_PLUGIN)
|
||||
|
||||
@@ -227,12 +246,15 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
|
||||
ADD_EXECUTABLE(${TARGET_TARGETNAME} ${PLATFORM_SPECIFIC_CONTROL} ${TARGET_SRC} ${TARGET_H})
|
||||
|
||||
ENDIF(${IS_COMMANDLINE_APP})
|
||||
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES OUTPUT_NAME ${TARGET_NAME})
|
||||
|
||||
IF(MSVC_IDE AND OSG_MSVC_VERSIONED_DLL)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../")
|
||||
ENDIF(MSVC_IDE AND OSG_MSVC_VERSIONED_DLL)
|
||||
|
||||
SETUP_LINK_LIBRARIES()
|
||||
|
||||
ENDMACRO(SETUP_EXE)
|
||||
@@ -286,12 +308,12 @@ ENDMACRO(SETUP_COMMANDLINE_EXAMPLE)
|
||||
|
||||
# Takes two optional arguments -- osg prefix and osg version
|
||||
MACRO(HANDLE_MSVC_DLL)
|
||||
#this is a hack... the build place is set to lib/<debug or release> by LIBARARY_OUTPUT_PATH equal to OUTPUT_LIBDIR
|
||||
#the .lib will be crated in ../ so going straight in lib by the IMPORT_PREFIX property
|
||||
#because we want dll placed in OUTPUT_BINDIR ie the bin folder sibling of lib, we can use ../../bin to go there,
|
||||
#it is hardcoded, we should compute OUTPUT_BINDIR position relative to OUTPUT_LIBDIR ... to be implemented
|
||||
#changing bin to something else breaks this hack
|
||||
#the dll are versioned by prefixing the name with osg${OPENSCENEGRAPH_SOVERSION}-
|
||||
#this is a hack... the build place is set to lib/<debug or release> by LIBARARY_OUTPUT_PATH equal to OUTPUT_LIBDIR
|
||||
#the .lib will be crated in ../ so going straight in lib by the IMPORT_PREFIX property
|
||||
#because we want dll placed in OUTPUT_BINDIR ie the bin folder sibling of lib, we can use ../../bin to go there,
|
||||
#it is hardcoded, we should compute OUTPUT_BINDIR position relative to OUTPUT_LIBDIR ... to be implemented
|
||||
#changing bin to something else breaks this hack
|
||||
#the dll are versioned by prefixing the name with osg${OPENSCENEGRAPH_SOVERSION}-
|
||||
|
||||
# LIB_PREFIX: use "osg" by default, else whatever we've been given.
|
||||
IF(${ARGC} GREATER 0)
|
||||
|
||||
@@ -11,15 +11,15 @@ SET(LIB_PUBLIC_HEADERS ${OpenThreads_PUBLIC_HEADERS})
|
||||
ADD_LIBRARY(${LIB_NAME}
|
||||
${OPENTHREADS_USER_DEFINED_DYNAMIC_OR_STATIC}
|
||||
${LIB_PUBLIC_HEADERS}
|
||||
PThread.c++
|
||||
PThreadBarrier.c++
|
||||
PThreadBarrierPrivateData.h
|
||||
PThreadCondition.c++
|
||||
PThreadConditionPrivateData.h
|
||||
PThreadMutex.c++
|
||||
PThreadMutexPrivateData.h
|
||||
PThreadPrivateData.h
|
||||
../common/Version.cpp
|
||||
PThread.c++
|
||||
PThreadBarrier.c++
|
||||
PThreadBarrierPrivateData.h
|
||||
PThreadCondition.c++
|
||||
PThreadConditionPrivateData.h
|
||||
PThreadMutex.c++
|
||||
PThreadMutexPrivateData.h
|
||||
PThreadPrivateData.h
|
||||
../common/Version.cpp
|
||||
)
|
||||
|
||||
IF(OPENTHREADS_SONAMES)
|
||||
@@ -27,7 +27,7 @@ IF(OPENTHREADS_SONAMES)
|
||||
ENDIF(OPENTHREADS_SONAMES)
|
||||
|
||||
SET(CMAKE_REQUIRED_LIBRARIES_SAFE "${CMAKE_REQUIRED_LIBRARIES}")
|
||||
SET(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}")
|
||||
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
||||
|
||||
CHECK_FUNCTION_EXISTS(pthread_yield HAVE_PTHREAD_YIELD)
|
||||
IF(HAVE_PTHREAD_YIELD)
|
||||
@@ -92,25 +92,25 @@ ENDIF(HAVE_PTHREAD_SETAFFINITY_NP)
|
||||
SET(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES_SAFE}")
|
||||
|
||||
TARGET_LINK_LIBRARIES(${LIB_NAME}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
)
|
||||
|
||||
# Since we're building different platforms binaries in
|
||||
# their respective directories, we need to set the
|
||||
# link directory so it can find this location.
|
||||
LINK_DIRECTORIES(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
INSTALL(
|
||||
TARGETS OpenThreads
|
||||
ARCHIVE DESTINATION lib${LIB_POSTFIX}
|
||||
LIBRARY DESTINATION lib${LIB_POSTFIX}
|
||||
RUNTIME DESTINATION bin
|
||||
TARGETS OpenThreads
|
||||
ARCHIVE DESTINATION lib${LIB_POSTFIX}
|
||||
LIBRARY DESTINATION lib${LIB_POSTFIX}
|
||||
RUNTIME DESTINATION bin
|
||||
)
|
||||
INSTALL(
|
||||
FILES ${OpenThreads_PUBLIC_HEADERS}
|
||||
DESTINATION include/OpenThreads
|
||||
FILES ${OpenThreads_PUBLIC_HEADERS}
|
||||
DESTINATION include/OpenThreads
|
||||
)
|
||||
|
||||
#commented out# INCLUDE(ModuleInstall OPTIONAL)
|
||||
|
||||
@@ -9,6 +9,7 @@ PROJECT(OSG_PLUGINS_MASTER)
|
||||
|
||||
IF(NOT MSVC)
|
||||
SET(LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH}/${OSG_PLUGINS}")
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${OSG_PLUGINS}")
|
||||
ENDIF(NOT MSVC)
|
||||
|
||||
SET(CMAKE_SHARED_MODULE_PREFIX ${OSG_PLUGIN_PREFIX})
|
||||
|
||||
Reference in New Issue
Block a user