Closed rafi closed 9 years ago
You probably want to set CMAKE_INSTALL_PREFIX
: cmake . -DCMAKE_INSTALL_PREFIX=/opt/local
.
See here for more details. Im not yet sure if that warning you get is relevant. Could be harmless too.
That's what I was trying with. When compiling sources without cmake I normally run make CFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib"
, but I'm not sure how to do it with cmake. I tried adding INCLUDE_DIRECTORIES(/opt/local/lib /opt/local/include)
in CMakeLists.txt
like I mentioned before, but still no luck, it fails at 82%..
I got you wrong then. You want to add custom cflags and ldflags. I understood initially you want to install the library into those directories.
You can try this:
cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_C_FLAGS= "-I/opt/local/include" -DCMAKE_EXE_LINKER_FLAGS="-L/opt/local/lib"
That's not really related to glyr though...
( http://stackoverflow.com/questions/6077414/cmake-how-to-set-the-ldflags-in-cmakelists-txt )
No luck either.. same error.
I was able to get passed the gthread-2.0 error on OS X using:
cmake . -DCMAKE_EXE_LINKER_FLAGS="-L/opt/local/lib" -DCMAKE_SHARED_LINKER_FLAGS="-L/opt/local/lib"
make
sudo make install
@RichieB2B thanks! Were you able to run it?
-- Install configuration: "release"
-- Installing: /opt/local/lib/pkgconfig/libglyr.pc
-- Installing: /opt/local/include/glyr/glyr.h
-- Installing: /opt/local/include/glyr/types.h
-- Installing: /opt/local/include/glyr/misc.h
-- Installing: /opt/local/include/glyr/cache.h
-- Installing: /opt/local/include/glyr/config.h
-- Installing: /opt/local/include/glyr/testing.h
-- Installing: /opt/local/lib/libglyr.1.1.0.dylib
-- Installing: /opt/local/lib/libglyr.1.dylib
-- Installing: /opt/local/lib/libglyr.dylib
-- Installing: /opt/local/bin/glyrc
$ glyrc
dyld: Library not loaded: libglyr.1.dylib
Referenced from: /opt/local/bin/glyrc
Reason: image not found
Trace/BPT trap: 5
Yes, it seems to be working fine. Did you completely rebuild all object? Just start from scratch with a fresh git clone.
$ glyrc
Usage: glyrc [GETTER] (options)
where [GETTER] must be one of:
- cover
- lyrics
- artistphoto
...
@RichieB2B thank you so much, it works.
Using OSX and Macports, how can I instruct the build to use /opt/local/lib and /opt/local/include? Tried adding
INCLUDE_DIRECTORIES(/opt/local/lib /opt/local/include)
in CMakeLists.txt, compilation reaches 82% but fails:I also receive this dev warning on cmake: