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

CMake support #7

Merged
merged 12 commits into from
Aug 6, 2015
Merged

CMake support #7

merged 12 commits into from
Aug 6, 2015

Conversation

sergiud
Copy link
Collaborator

@sergiud sergiud commented Mar 23, 2015

This series of patches adds CMake support to glog and fixes several compilation issues.

My primary goal was to be able to compile glog on Windows using Visual Studio without any hassle. The modifications have been tested using VC 8.0 through VC 14.0 CTP 6, cygwin gcc 4.9.2, Intel C++ Compiler 15.0, Apple Clang, and on Arch Linux using gcc 4.9.2 and clang 3.6 (both static and shared builds).

CMakeLists.txt also generates config files, which allow to use glog in CMake projects easily:

cmake_minimum_required (VERSION 2.8.11)
project (myproject)

find_package (glog 0.3.4)

add_executable (myproject myproject.cpp)
target_link_libraries (myproject glog)

To run the unit tests, execute:

make test

when using the Makefiles generator.

@ukai
Copy link
Contributor

ukai commented Mar 27, 2015

on ubuntu/trusty at commit 82823b0

$ ./configure && make
...
In file included from src/demangle.cc:38:0:
src/demangle.h:80:27: error: expected initializer before 'Demangle'
bool GOOGLE_GLOG_DLL_DECL Demangle(const char mangled, char *out, int out_size);
^
make: *
* [src/libglog_la-demangle.lo] Error 1

@ukai
Copy link
Contributor

ukai commented Mar 27, 2015

same error at commit 0caa067

@sergiud
Copy link
Collaborator Author

sergiud commented Mar 27, 2015

It's commit ab0a2da that causes the problem. The demangle.h header is missing an #include "config.h". I'll fix that.

@sergiud
Copy link
Collaborator Author

sergiud commented Mar 27, 2015

Actually, GOOGLE_GLOG_DLL_DECL was missing. I fixed that.

@sergiud sergiud force-pushed the master branch 7 times, most recently from c89b512 to 0732986 Compare April 2, 2015 16:43
@sergiud sergiud force-pushed the master branch 2 times, most recently from 84dc748 to 44a22f8 Compare April 7, 2015 09:52
@ukai
Copy link
Contributor

ukai commented Apr 10, 2015

still failing with autoconf at commit 44a22f8

$ ./configure && make
...
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I./src -I./src -Wall -Wwrite-strings
-Woverloaded-virtual -Wno-sign-compare -DNO_FRAME_POINTER -DNDEBUG -g -O2 -MT s
rc/libglog_la-logging.lo -MD -MP -MF src/.deps/libglog_la-logging.Tpo -c src/log
ging.cc -fPIC -DPIC -o src/.libs/libglog_la-logging.o
In file included from src/utilities.h:82:0,
from src/logging.cc:32:
src/glog/logging.h:290:12: error: 'GOOGLE_GLOG_DLL_DECL' does not name a type
extern GOOGLE_GLOG_DLL_DECL type FLAGS_##name;
^

@sergiud
Copy link
Collaborator Author

sergiud commented Apr 11, 2015

I'm not seeing this error on Arch Linux. GOOGLE_GLOG_DLL_DECL is clearly defined in config.h.in. See sergiud@0938ff4#diff-d23f5b7090d56af546252d03336564a3R182.

@sergiud
Copy link
Collaborator Author

sergiud commented Apr 11, 2015

I can reproduce the problem on Ubuntu 12.04. Will look into it.

@sergiud
Copy link
Collaborator Author

sergiud commented Apr 30, 2015

Can you please check again?

@gregoire-astruc
Copy link

Will this be approved and merged? This is definitely something I'm looking for.

@eelstork
Copy link

Looks promising; also interested in this.

@sergiud sergiud force-pushed the master branch 2 times, most recently from 37841fa to 8453b08 Compare July 15, 2015 20:39
@haosdent
Copy link

+1

1 similar comment
@curtpm
Copy link

curtpm commented Jul 30, 2015

+1

ukai added a commit that referenced this pull request Aug 6, 2015
Add CMake support. closes #4
@ukai ukai merged commit fe13644 into google:master Aug 6, 2015
@haosdent
Copy link

haosdent commented Aug 6, 2015

@hausdorff glog support cmake now :-)

@eelstork
Copy link

eelstork commented Aug 6, 2015

Good work!

@jakirkham
Copy link

When will this be included in a release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants