diff options
author | Jörg Mayer <jmayer@loplof.de> | 2013-10-08 20:41:57 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2013-10-08 20:41:57 +0000 |
commit | 08637912532b7c83a151d35cefe396520df8c3c8 (patch) | |
tree | a2ff8dd5ae8cfcfe876e4382d6784c372768d807 /CMakeLists.txt | |
parent | 69473b4645a3fcddb8aed14ab2f44fa9076d4aba (diff) |
Try to set PATH on Windows to all required dlls/libs to allow
running the executables from the build tree without installation.
It doesn't really work yet but the troubleshooting has to wait
until either I've gotten some sleep or someone else fixes it.
svn path=/trunk/; revision=52454
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0db66a83af..a60e8b1b44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -455,6 +455,7 @@ foreach(PACKAGE ${PACKAGELIST}) if (${PACKAGE_VAR}_FOUND) set(HAVE_LIB${PACKAGE_VAR} 1) include_directories(${${PACKAGE_VAR}_INCLUDE_DIRS}) + set(WS_ALL_LIBS ${WS_ALL_LIBS} ${${PACKAGE_VAR}_LIBRARIES}) message(STATUS "${PACKAGE} includes: ${${PACKAGE_VAR}_INCLUDE_DIRS}") message(STATUS "${PACKAGE} libs: ${${PACKAGE_VAR}_LIBRARIES}") if (${PACKAGE}_DEFINITIONS) @@ -466,6 +467,27 @@ foreach(PACKAGE ${PACKAGELIST}) endif() endforeach() +# Add paths required to run the executables inside the build dir + +if(WIN32) + if( "$ENV{PATH}" MATCHES "${CMAKE_BINARY_DIR}/lib") + message( STATUS "Build dir (${CMAKE_BINARY_DIR}/lib) already in path." ) + else() + # message( STATUS "All libs: ${WS_ALL_LIBS}\n" ) + foreach( THIS_LIB_PATH ${WS_ALL_LIBS} ) + get_filename_component( LIB_PATH ${THIS_LIB_PATH} PATH ) + # message( STATUS "Raw path ${THIS_LIB_PATH} processed to ${LIB_PATH}." ) + set( WS_LOCAL_LIB_PATHS ${WS_LOCAL_LIB_PATHS} ${LIB_PATH} ) + endforeach() + list(REMOVE_DUPLICATES WS_LOCAL_LIB_PATHS) + # All generated libs go here, so start our libsearch in this place + set(WS_LOCAL_LIB_PATHS "${CMAKE_BINARY_DIR}/lib" ${WS_LOCAL_LIB_PATHS}) + message( STATUS "Adding paths: ${WS_LOCAL_LIB_PATHS}" ) + set( ENV{PATH} $ENV{PATH} ${WS_LOCAL_LIB_PATHS} ) + endif() +endif() + + # Provide Windows system lib names include( UseWinLibs ) |