Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling Octomap under Windows 7 VC++2008, CMake warning (Qt4) #44

Closed
tmdiv opened this issue Sep 4, 2013 · 5 comments
Closed

Compiling Octomap under Windows 7 VC++2008, CMake warning (Qt4) #44

tmdiv opened this issue Sep 4, 2013 · 5 comments
Labels

Comments

@tmdiv
Copy link
Contributor

tmdiv commented Sep 4, 2013

Whilie generating Visual Studio *.sln CMake 2.8.10.1 shows warning. The produced *.sln has improper lib dependencies. The same situation appears with octomap 1.6.1, 1.6.0. Is this a bug or CMake (gui) problem?

CMAKE WARNING
Make Warning (dev) at octovis/CMakeLists_src.txt:96 (add_executable):
  Policy CMP0008 is not set: Libraries linked by full-path must have a valid
  library file name.  Run "cmake --help-policy CMP0008" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  Target "octovis" links to item

    C:/octomap-1.6.1/lib/liboctomap.so

  which is a full-path but not a valid library file name.
Call Stack (most recent call first):
  octovis/CMakeLists.txt:72 (INCLUDE)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at octovis/CMakeLists_src.txt:96 (add_executable):
  Policy CMP0008 is not set: Libraries linked by full-path must have a valid
  library file name.  Run "cmake --help-policy CMP0008" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  Target "octovis" links to item

    C:/octomap-1.6.1/lib/liboctomath.so

  which is a full-path but not a valid library file name.
Call Stack (most recent call first):
  octovis/CMakeLists.txt:72 (INCLUDE)
This warning is for project developers.  Use -Wno-dev to suppress it.
@ahornung
Copy link
Member

ahornung commented Sep 4, 2013

That sounds like a valid warning to me, probably due to some change in CMake behavior. The file octomap/octomap-config.cmake.in probably needs an extra case for Windows (.dll) in here:

if(APPLE)
  set(SO_EXT ".dylib")
else(APPLE)
  set(SO_EXT ".so")
endif(APPLE)

Although I wonder if there is a more portable CMake way instead...

@ahornung
Copy link
Member

ahornung commented Sep 4, 2013

Using CMAKE_SHARED_LIBRARY_SUFFIX instead of SO_EXT (and deleting the if-else-block) should fix this

@tmdiv
Copy link
Contributor Author

tmdiv commented Sep 4, 2013

Thank you for fast help.
After this change (removed if-else and added "set(CMAKE_SHARED_LIBRARY_SUFFIX)") still there is CMake warning. The only difference is that the filename is without *.so extention.

@ahornung
Copy link
Member

ahornung commented Sep 4, 2013

@tmdiv check the commit above, can you test if this fixes it for you? You can try the code from the "devel-cmake-suffix" branch. To debug, can you post the contents of the file lib/cmake/octomap/octomap-config.cmake?

@tmdiv
Copy link
Contributor Author

tmdiv commented Sep 4, 2013

I have tried the fix. There is no CMake warning. Still VS projects: compare_octrees, exampleEDTOctomap, exampleEDT3D, octovis can't see liboctomap.dll, but there is no problem with liboctomath now.
The content of lib/cmake/octomap/octomap-config.cmake (after this fix) is below. The dlls are in C:/mapping/octomap-1.6.1/lib/debug (release)

## removed commented text ##

 set(OCTOMAP_INCLUDE_DIRS C:/mapping/octomap-1.6.1/octomap/include)
set(OCTOMAP_LIBRARY_DIRS C:/mapping/octomap-1.6.1/lib)


# Set library names as absolute paths:
set(OCTOMAP_LIBRARIES
  C:/mapping/octomap-1.6.1/lib/liboctomap.dll
  C:/mapping/octomap-1.6.1/lib/liboctomath.dll
)

ahornung pushed a commit that referenced this issue Sep 4, 2013
Fix #44: CMAKE_SHARED_LIBRARY_SUFFIX in CMakeConfig for abs.library path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants