[CMake] Problem with try_compile() for iOS

2019-04-15 Thread Eric Doenges
Hi, I'm currently testing CMake 3.14.2's iOS support with our build system and ran into a problem with try_compile() not finding the binary. Here is an example while trying to configure libjpeg-turbo 2.0.2 (I've shortened the paths to make this easier to read): --- SNIP --- -- Check size

Re: [CMake] Question about running C code from within cmake

2019-06-03 Thread Eric Doenges
The easiest way to get the number of cores on your Windows build machine from within CMake is to get the value of the NUMBER_OF_PROCESSORS environment variable using $ENV{NUMBER_OF_PROCESSORS}. Am 02.06.19 um 14:16 schrieb Steven Truppe: Hi everyone, i'm trying to search for a way for

Re: [CMake] Troubles compiling llvm

2019-05-23 Thread Eric Doenges
um 11:28 schrieb Eric Doenges: Hi Steven, I would assume the problem is that you do not have write permissions for /usr/lib. You either need to give yourself the appropriate rights, our run the build as root (which is probably a very bad idea). If you don't want to actually install to /usr

Re: [CMake] Troubles compiling llvm

2019-05-23 Thread Eric Doenges
Hi Steven, I would assume the problem is that you do not have write permissions for /usr/lib. You either need to give yourself the appropriate rights, our run the build as root (which is probably a very bad idea). If you don't want to actually install to /usr/lib, you can pass a different

Re: [CMake] Embedded build using ExternalProject

2019-06-27 Thread Eric Doenges
Am 26.06.19 um 15:53 schrieb Torsten Robitzki: A third issue that I have is, that changes to the CMakeLists.txt files in the Project are not reflected by the super build. If I make a change to one of the CMake files under ${CMAKE_CURRENT_LIST_DIR}/source, I usually have to delete the whole

Re: [CMake] modify cmake build arguments

2019-08-29 Thread Eric Doenges
On 29.08.2019 22:38, fdk17 wrote: On Thu, Aug 29, 2019, at 2:52 PM, Kyle Edwards via CMake wrote: On Thu, 2019-08-29 at 18:27 +0100, hex wrote: > hello community, >  >

Re: [CMake] external project CONFIGURE_COMMAND adds quotation to arguments

2019-09-04 Thread Eric Doenges
On 04.09.2019 11:55, Edoardo Pasca wrote: Dear all,  I'm using ExternalProjectAdd to build an external package.  On the CONFIGURE_COMMAND I have to pass some variables to the configure script in

Re: [CMake] toolchain file - cross-compiling windows-amd64->windows-x86

2019-09-17 Thread Eric Doenges
We use ninja for building on Windows. Our toolchain file for the MSVC compiler is really simple (this is for MSVC 18.0, 32 bits): --- SNIP --- set(CMAKE_SYSTEM_NAME Windows) set(CMAKE_SYSTEM_PROCESSOR "x86") set(CMAKE_SYSTEM_VERSION 1) # Microsoft MSVC compiler set(CMAKE_C_COMPILER cl.exe)

Re: [CMake] toolchain file - cross-compiling windows-amd64->windows-x86

2019-09-18 Thread Eric Doenges
) with the path, but what path? kkk Em qua, 18 de set de 2019 às 02:50, Eric Doenges <mailto:doen...@mvtec.com>> escreveu: We use ninja for building on Windows. Our toolchain file for the MSVC compiler is really simple (this is for MSVC 18.0, 32 bits): --- SNIP ---

Re: [CMake] find_file - strange behavior when using Android toolchain

2019-07-31 Thread Eric Doenges
Am 31.07.19 um 08:20 schrieb Stephan Menzel: Hello all, I'm trying to adapt my CMake based toolchain to Android and I'm noticing very strange behavior that I'd like to ask about. My toolchain is C++ based with some dependencies such as Boost, OpenSSL or protobuf. So far it works on a variety

Re: [CMake] question about version details in source code

2019-07-17 Thread Eric Doenges
Am 17.07.19 um 15:38 schrieb hex: hello community, I am receiving a|fatal error: foobar_version.h: No such file or directory|for|foobar_version.h|. The reason is that the source file is generated in|${CMAKE_CURRENT_BINARY_DIR}/foobar_version.cpp|while the header file is

Re: [CMake] file dependency not working in external projects

2019-09-24 Thread Eric Doenges
You're probably missing the BUILD_ALWAYS option to ExternalProject_Add: |BUILD_ALWAYS | Enabling this option forces the build step to always be run. This can be the easiest way to robustly ensure that the external project’s own build dependencies are evaluated rather than relying on

Re: [CMake] printing CMAKE_CXX_FLAGS_* based on build type

2019-09-29 Thread Eric Doenges
Unfortunately, the standard values for CMAKE_BUILD_TYPE only have their first letter capitalized, i.e. for a release build CMAKE_BUILD_TYPE will normally be "Release". To use it like you want to, it would need to be "RELEASE". To get around this problem, we define an all upper-case BUILD_TYPE

Re: [CMake] FindBLAS + MKL + Ctest fails on MacOS (SIP)

2019-07-10 Thread Eric Doenges
The simplest way to do this is to use the BUILD_RPATH and/or INSTALL_RPATH properties, i.e. something like: list(GET BLAS_LIBRARIES 0 _BLAS_FIRSTLIB) get_filename_component(_BLAS_LIBDIR "${_BLAS_FIRSTLIB}" DIRECTORY set_target_properties(test_blas PROPERTIES BUILD_RPATH "${_BLAS_LIBDIR}") This

Re: [CMake] Using CMake with TI armcl and armar

2019-11-11 Thread Eric Doenges
Am 09.11.19 um 00:15 schrieb Samyukta Ramnath: I want to add a CC1352P1_LAUNCHXL_TIRTOS.cmd  file, which has been added in the CCS linker command, but I am unable to include It in my linker command. I tried the following things : set(LINKER_SCRIPT "${LWIP_DIR}/CC1352P1_LAUNCHXL_TIRTOS.cmd")

Re: [CMake] Using CMake with TI armcl and armar

2019-11-07 Thread Eric Doenges
Am 07.11.19 um 18:01 schrieb samyuktar: SET(CMAKE_C_LINK_EXECUTABLE "${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} --c_file=../main.c -z --map_file=${TARGET_NAME}.map --output_file=${TARGET_NAME} ${PLATFORM_CONFIG_L_FLAGS} ${CMD_SRCS} ${LIB} --include_path ${LWIP_INCLUDE_DIR} --verbose " CACHE STRING

Re: [CMake] Accessing -fPIC and -std settings within CMake definitions

2019-11-03 Thread Eric Doenges
Am 01.11.19 um 11:02 schrieb Stephen Morris: I'm setting up a custom build step to build a precompiled header in gcc (yes I know that native support is coming with CMake 3.16, but I need to get something working on an older version). My approach is basically to set up a custom command thus:

Re: [CMake] Stray backslash appearing when CMAKE_CXX_FLAGS_RELEASE used in custom command

2019-11-03 Thread Eric Doenges
Am 01.11.19 um 17:24 schrieb Stephen Morris: On 1 November at 10:02, Stephen Morris wrote: My approach is basically to set up a custom command thus: set(CXX_FLAGS ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}) .. or whatever, depending on the current configuration..

Re: [CMake] Got Weird Error When Trying to Configure LLVM Version 10

2019-10-28 Thread Eric Doenges
MSBuild is complaining that the generated project file doesn't contain a 32 bit debug target - which is no surprise, because you told CMake to generate a project for a release build. You will probably need to tell msbuild.exe that you want to build a release build with the

Re: [CMake] How to Switch to Static Runtime on Command Line?

2019-10-28 Thread Eric Doenges
I think it is worth adding to what Mateusz wrote that the MSVC_RUNTIME_LIBRARY property / CMAKE_MSVC_RUNTIME_LIBRARY variable are only available if policy CMP0091 is set to NEW, which it will not be because LLVM's CMakeLists.txt only requires CMake 3.4.3 or later (and thus all policies

Re: [CMake] How to Switch to Static Runtime on Command Line?

2019-10-28 Thread Eric Doenges
By default, CMake will use /EHsc when compiling for the Windows platform, with no option to change this that I am aware of. If a project wants different settings, it needs to handle this itself. And in fact, LLVM 3.4.2 conditionally modifies /EHsc to /EHs-c- in

Re: [CMake] CMake 3.15 fails to install on OS X

2019-10-14 Thread Eric Doenges
System Integrity Protection (SIP, introduced with macOS 10.11) prevents you from writing into various system directories (like /usr) even as the root user. You can either install cmake to a different location (like /usr/local, which apparently is not protected), or disable SIP entirely (which

Re: [CMake] modifying cmake_build_type cflags per target

2019-11-19 Thread Eric Doenges
Am 19.11.19 um 22:51 schrieb Craig Scott: On Tue, Nov 19, 2019 at 10:36 PM Eric Doenges <mailto:doen...@mvtec.com>> wrote: Am 19.11.19 um 12:09 schrieb Stéphane Ancelot: Hi, I have a particular target (using swig / jni) that must not have -O3 -NDEBUG flags fr

Re: [CMake] modifying cmake_build_type cflags per target

2019-11-19 Thread Eric Doenges
Am 19.11.19 um 12:09 schrieb Stéphane Ancelot: Hi, I have a particular target (using swig / jni) that must not have -O3 -NDEBUG flags from Relase build type How can I overload this target flags ? Since CMAKE__FLAGS_RELEASE does not map to a user-visible target property, you cannot

Re: [CMake] Question about list ordering

2019-11-12 Thread Eric Doenges
The list command is what you want. Specifically, list(GET ...) will return the index of a string in the list, and list(INSERT ...) and list(REMOVE_ITEM ...) or list(REMOVE_AT ...) to insert and remove items. Am 13.11.19 um 00:56 schrieb

Re: [CMake] Debug logging of items

2019-09-20 Thread Eric Doenges
I don't know about the targets, but you can get all variables currently defined for a directory by reading the VARIABLES property, e.g. get_property(_variables DIRECTORY "${CMAKE_SOURCE_DIR}" PROPERTY VARIABLES) I use this to dump the variables into a file so I can see with which variable

Re: [CMake] MacOS and shared libraries from imported targets

2019-09-25 Thread Eric Doenges
As far as I am aware, the macOS linker simply records the install name of the dynamic library you link against in your executable (similar to how the Linux linker records the Elf SONAME, if present). So, the first step would be to check the install name of the external dynamic library by

Re: [CMake] find_package to find Cygwin versions of Flex and Bison in Windows

2020-03-05 Thread Eric Doenges
You can prepend C:\cygwin64\bin to the CMAKE_PROGRAM_PATH variable so that it looks there first.  While the find_package documentation does not mention CMAKE_PROGRAM_PATH, I know this works for bison and flex because that is what we do in our project (presumably, find_program is used

Re: [CMake] build step is not thread-safe for CMake

2020-02-11 Thread Eric Doenges
Am 10.02.20 um 14:23 schrieb Kyle Edwards via CMake: On Mon, 2020-02-10 at 12:49 +, hex wrote: hello, My build step is not thread-safe (the instruction in the COMMAND part). Every build step depends on one source file: add_custom_command(     DEPENDS on_source.file     OUTPUT