-
Notifications
You must be signed in to change notification settings - Fork 267
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
Update CMake scripts #160
base: master
Are you sure you want to change the base?
Update CMake scripts #160
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
MinGW can't compile multiple .rc files. Only single. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps a better fix, simpler for MinGW, would be to include |
||
*/ | ||
|
||
#include "../translations/translations.rc" | ||
#include "../src/winsparkle.rc" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
project(expat) | ||
|
||
set(SOURCE_DIR ${ROOT_DIR}/3rdparty/expat) | ||
set(SOURCE_DIR ${ROOT_DIR}/3rdparty/expat/expat) | ||
|
||
file(COPY ${SOURCE_DIR}/expat_config.h.cmake | ||
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR} | ||
) | ||
|
||
cmake_minimum_required(VERSION 2.6) | ||
set(PACKAGE_BUGREPORT "[email protected]") | ||
set(PACKAGE_NAME "expat") | ||
set(PACKAGE_VERSION "2.1.0") | ||
set(PACKAGE_VERSION "2.2.3") | ||
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") | ||
set(PACKAGE_TARNAME "${PACKAGE_NAME}") | ||
|
||
|
@@ -31,8 +35,11 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR} ${SOURCE_DIR}/lib) | |
if(MSVC) | ||
add_definitions(-D_CRT_SECURE_NO_WARNINGS -wd4996) | ||
endif(MSVC) | ||
add_definitions(-DWIN32) | ||
add_definitions(-DXML_STATIC) | ||
|
||
set(expat_SRCS | ||
${SOURCE_DIR}/lib/loadlibrary.c | ||
${SOURCE_DIR}/lib/xmlparse.c | ||
${SOURCE_DIR}/lib/xmlrole.c | ||
${SOURCE_DIR}/lib/xmltok.c | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
/* expat_config.h.in. Generated from configure.in by autoheader. */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you need this file at all, when it wasn't previously needed? This doesn't seem right, surely this won't be accurate for all possible compilers. |
||
|
||
/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ | ||
#cmakedefine BYTEORDER @BYTEORDER@ | ||
|
||
/* Define to 1 if you have the `bcopy' function. */ | ||
#cmakedefine HAVE_BCOPY | ||
|
||
/* Define to 1 if you have the <dlfcn.h> header file. */ | ||
#cmakedefine HAVE_DLFCN_H | ||
|
||
/* Define to 1 if you have the <fcntl.h> header file. */ | ||
#cmakedefine HAVE_FCNTL_H | ||
|
||
/* Define to 1 if you have the `getpagesize' function. */ | ||
#cmakedefine HAVE_GETPAGESIZE | ||
|
||
/* Define to 1 if you have the <inttypes.h> header file. */ | ||
#cmakedefine HAVE_INTTYPES_H | ||
|
||
/* Define to 1 if you have the `memmove' function. */ | ||
#cmakedefine HAVE_MEMMOVE | ||
|
||
/* Define to 1 if you have the <memory.h> header file. */ | ||
#cmakedefine HAVE_MEMORY_H | ||
|
||
/* Define to 1 if you have a working `mmap' system call. */ | ||
#cmakedefine HAVE_MMAP | ||
|
||
/* Define to 1 if you have the <stdint.h> header file. */ | ||
#cmakedefine HAVE_STDINT_H | ||
|
||
/* Define to 1 if you have the <stdlib.h> header file. */ | ||
#cmakedefine HAVE_STDLIB_H | ||
|
||
/* Define to 1 if you have the <strings.h> header file. */ | ||
#cmakedefine HAVE_STRINGS_H | ||
|
||
/* Define to 1 if you have the <string.h> header file. */ | ||
#cmakedefine HAVE_STRING_H | ||
|
||
/* Define to 1 if you have the <sys/stat.h> header file. */ | ||
#cmakedefine HAVE_SYS_STAT_H | ||
|
||
/* Define to 1 if you have the <sys/types.h> header file. */ | ||
#cmakedefine HAVE_SYS_TYPES_H | ||
|
||
/* Define to 1 if you have the <unistd.h> header file. */ | ||
#cmakedefine HAVE_UNISTD_H | ||
|
||
/* Define to the address where bug reports for this package should be sent. */ | ||
#cmakedefine PACKAGE_BUGREPORT | ||
|
||
/* Define to the full name of this package. */ | ||
#cmakedefine PACKAGE_NAME | ||
|
||
/* Define to the full name and version of this package. */ | ||
#cmakedefine PACKAGE_STRING | ||
|
||
/* Define to the one symbol short name of this package. */ | ||
#cmakedefine PACKAGE_TARNAME | ||
|
||
/* Define to the version of this package. */ | ||
#cmakedefine PACKAGE_VERSION | ||
|
||
/* Define to 1 if you have the ANSI C header files. */ | ||
#cmakedefine STDC_HEADERS | ||
|
||
/* whether byteorder is bigendian */ | ||
#cmakedefine WORDS_BIGENDIAN | ||
|
||
/* Define to specify how much context to retain around the current parse | ||
point. */ | ||
#cmakedefine XML_CONTEXT_BYTES @XML_CONTEXT_BYTES@ | ||
|
||
/* Define to make parameter entity parsing functionality available. */ | ||
#cmakedefine XML_DTD | ||
|
||
/* Define to make XML Namespaces functionality available. */ | ||
#cmakedefine XML_NS | ||
|
||
/* Define to __FUNCTION__ or "" if `__func__' does not conform to ANSI C. */ | ||
#ifdef _MSC_VER | ||
# define __func__ __FUNCTION__ | ||
#endif | ||
|
||
/* Define to `long' if <sys/types.h> does not define. */ | ||
#cmakedefine off_t @OFF_T@ | ||
|
||
/* Define to `unsigned' if <sys/types.h> does not define. */ | ||
#cmakedefine size_t @SIZE_T@ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is yet another place where languages list has to be maintained (and manually). Is there no way in CMake to look for all available *.po files instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use
file(GLOB VARIABLE ${ROOT_DIR}/translations/*.po CONFIGURE_DEPENDS)
(https://cmake.org/cmake/help/v3.12/command/file.html#glob), but it was new in CMake 3.12 so you'd have to rause your cmake_minimum_required quite a bit. Before that there was no way to get CMake to re-configure if the glob results change. I'm not sure if 2.8 (which is your current minimum) even has file(GLOB) at all.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@puetzk Thanks! How problematic is raising CMake version? I think not much on Windows where distro packaging doesn't enter the picture… AppVeyor, which I care about for CI, already includes 3.13.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@puetzk However not using CMake myself, I don't really know how to translate your advice into actual code; a patch/PR would be tremendously helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file(GLOB) available at least since CMake 2.6, so no raising is required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that's missing CONFIGURE_DEPENDS (which is what was new in 3.12), so it won't reconfigure properly if the filesystem changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if and only if:
In that case the build won't include new files.
If you run cmake (configure) command manually (which you normally do, if you have CI, or smth) - everything works.
If you remove existing .po file - build reasonably fails, until you run cmake.
If you do a clean build - everything works by default anyway.
Don't think this small feature is worth considering raising minimal required cmake version, specially for build system that is not officially supported.
I've seen two approaches, which I'd support widely:
Anything in between sounds like not a great compromise.