sahib / glyr

Glyr is a music related metadata searchengine, both with commandline interface and C API
GNU Lesser General Public License v3.0
248 stars 23 forks source link

CMake Fails In Cygwin #59

Open bambams opened 9 years ago

bambams commented 9 years ago

I'm not sure if this is a cmake version issue or a Cygwin compatibility issue.

(Without -DCMAKE_LEGACY_CYGWIN_WIN32 you are warned also about WIN32 not being defined for Cygwin anymore, but both ways it fails at the same point)

$ cmake --version
cmake version 3.1.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).
$ cmake -DCMAKE_LEGACY_CYGWIN_WIN32=1 -DCMAKE_INSTALL_PREFIX="$HOME" .
-- The C compiler identification is GNU 4.9.2
-- Defining WIN32 under Cygwin due to CMAKE_LEGACY_CYGWIN_WIN32
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PkgConfig: /usr/bin/pkg-config.exe (found version "0.28")
-- Building Target: release
-- Found CURL: /usr/lib/libcurl.dll.a (found version "7.40.0")
-- checking for modules 'glib-2.0>=2.10;gthread-2.0'
--   found glib-2.0, version 2.42.1
--   found gthread-2.0, version 2.42.1
-- checking for module 'sqlite3'
--   found sqlite3, version 3.8.8.2
CMake Error at lib/CMakeLists.txt:33 (INSTALL):
  install Library TARGETS given no DESTINATION!

-- Configuring incomplete, errors occurred!
See also "/c/Users/bambams/src/glyr/CMakeFiles/CMakeOutput.log".

There don't appear to be any actual failures in CMakeOutput.log... At least, :set ic | /error has no matches and I don't see anything else that indicates failures...

sahib commented 9 years ago

As far as I can tell from the error INSTALL_LIB_DIR is empty for some reason. The error is not very descriptive, but gives a line in the CMakeFile at least.

Maybe try to give it an explicit value via -DINSTALL_LIB_DIR=$path_where_the_library_should_be_installed.

bambams commented 9 years ago

That is what I thought too, but it doesn't seem to be the case:

bash$ vim lib/CMakeLists.txt
bash$ git diff
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 528f32e..cecf83a 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -30,4 +30,5 @@ INSTALL(FILES misc.h    DESTINATION ${INSTALL_INC_DIR}/glyr)
 INSTALL(FILES cache.h   DESTINATION ${INSTALL_INC_DIR}/glyr)
 INSTALL(FILES config.h  DESTINATION ${INSTALL_INC_DIR}/glyr)
 INSTALL(FILES testing.h DESTINATION ${INSTALL_INC_DIR}/glyr)
+MESSAGE("The value of INSTALL_LIB_DIR is \"${INSTALL_LIB_DIR}\"")
 INSTALL(TARGETS glyr LIBRARY DESTINATION ${INSTALL_LIB_DIR})
bash$ cmake -DCMAKE_LEGACY_CYGWIN_WIN32=1 -DCMAKE_INSTALL_PREFIX="$HOME" .
-- Defining WIN32 under Cygwin due to CMAKE_LEGACY_CYGWIN_WIN32
-- Building Target: release
The value of INSTALL_LIB_DIR is "lib"
CMake Error at lib/CMakeLists.txt:34 (INSTALL):
  install Library TARGETS given no DESTINATION!

-- Configuring incomplete, errors occurred!
See also "/c/Users/TCAC0108/src/glyr/CMakeFiles/CMakeOutput.log".

For emphasis:

The value of INSTALL_LIB_DIR is "lib"