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
Improve CMake code for the case Win + CMake + Visual Studio #22
Conversation
…AR and use directly PRIVATE or PUBLIC
…ols. Link always with EXPAT_LIBARIES
This looks very good, Luis. I'm building/testing 9 different builds. Mostly good. Xcode produces a warning about "stdc++lib is deprecated, use c++lib" (or something like that). I'm using CMake 3.5.1 on the Mac (3.9 on Windows). I will upgrade CMake tomorrow and build again on Xcode. msvc/exiv2.sln fails on missing exv_conf file. B = Builds F = Fails to build
1 = stdc++lib deprecated warning |
The fix for "deprecated stdc++lib" warning is to build against MacOSX 10.9 sdk. Add this to CMakeLists.txt after include(config/findDepenencies.cmake)
Caution: We must put the information about MacOSX10.9.sdk into README-CMAKE. I may even report two bugs to KitWare. CMake should be using this when performing compiler tests. CMake should report MacOSX10.9.sdk as missing. When MacOSX10.9.sdk is absent, Xcode generates hundreds of compilation errors in Exiv2 code such as src/version.cpp, exiv2.cpp. There is nothing in those messages to cause the user to realise that the target SDK is missing. I think we should either:
Comment: I am not submitting MacOSX10.9.sdk to our repos. It's 350mb (40mb compressed) and will make our repos FAT. The my strategy for dealing with fat files which are occasionally used (e.g. some test files) is to keep them in svn://dev.exiv2.org/svn/team and download on-demand. |
I've restored the file include/exiv2/exv_msvc.h and modified msvc/libexiv2/libexiv2.vcproj to copy exv_msvc.h to exv_conf.h before building the library. This is a local change in the msvc tree (which I own) and will have no impact on the CMake and Autotools environments. |
Luis I think there's a bug in the installation of exv_conf.h (into /usr/local/include/exiv2). If I've been building with the autotools, CMake doesn't overwrite that file. It reports it as "up-to-date". |
True Robin, I forgot to take care of the installation of the file. I will take a look today, normally the installation of files with CMake is easy to handle. |
After the previous changes related with the generation of the
exv_conf.h
file, I have spent some time on Windows and I have improving few things:exv_conf.h
file is not generated inside the source_tree but in the CMAKE_BINARY_DIR. Then we use the cmake commandinclude_directories
to make that file visible for the full project.