Re: [cmake-developers] [CMake 0015669]: XCTest for iOS target has incorrect TEST_HOST
Hi Brad, On 21/08/15 15:36, Brad King wrote: Thanks. I merged to 'next' for testing last night. Please take a look at the failures: https://open.cdash.org/testSummary.php?project=1&name=RunCMake.XcodeProject&date=2015-08-21 It's all green now: https://open.cdash.org/testSummary.php?project=1&name=RunCMake.XcodeProject&date=2015-08-24 Thanks, Gregor -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers
[cmake-developers] cmake's built-in support for android using nvidia nsight tegra
TLDR: How do I tell cmake to include "Ant Build" in my vcxproj, so that it will package my project into an APK? I can generate vcxproj that builds a Tegra-Android *.so file, but it does not build me an APK, and my vcxproj is missing the "Ant Build" property section. As a reference, if I use Visual Studio 2010 to create a new project > Nsight Tegra > Android Native Application, then it has an "Ant Build" property section, and it does build me an APK, and I can run this on my Android device from Visual Studio using ctrl+F5. thank you for any leads --- Long Version CMake recently added built-in support for cross-compiling Windows to Android: http://www.cmake.org/cmake/help/v3.1/manual/cmake-toolchains.7.html#cross-compiling-using-nvidia-nsight-tegra I am attempting to use the built-in CMake Android support. I actually don't care if it's Nsight Tegra or what, but since it's officially built-in to CMake then I feel like maybe that's simpler and more standard (less hacky) than alternatives like ( https://github.com/taka-no-me/android-cmake ). I don't mind that it's for Windows Visual Studio 2010 only. So I installed AndroidWorks and now I have two copies of the Android SDK & JDK such as (C:\Programs\NVPACK\android-ndk-r10e\) and (C:\Programs\Android\android-ndk-r10e). But that's not my question. I also noticed that I can only generate CMake Android with Visual Studio 2010, even though the release notes say "2010 or newer". But that's not my question. I'm able to use Visual Studio 2010 to create a new project > Nsight Tegra > Android Native Application. I can build the project and run it on my Android device (actually it's a Kindle Fire HD 6) from inside Visual Studio 2010 using Ctrl+F5. I'm able to use CMake to generate a similar project "pemDemos". Here are some relevant parts of my CMakeLists.txt. I got the android.bat idea from here ( http://bit.ly/1hTZuRB ). [BEGIN CMakeLists.txt] project(pemDemos) cmake_minimum_required(VERSION 2.8.6) aux_source_directory(. SRC_LIST) add_definitions("-std=c++11") set(dirSDLmain ${CMAKE_CURRENT_SOURCE_DIR}/../../SDL2-2.0.3/libs/armeabi) set(dirSDL ${CMAKE_CURRENT_SOURCE_DIR}/../../SDL2-2.0.3/libs/armeabi) set(ANDROID_SDK "C:/Programs/NVPACK/android-sdk-windows") set(ANDROID_NDK "C:/Programs/NVPACK/android-ndk-r10e") # this is how we get our NDK *.so binaries into an APK execute_process(COMMAND ${ANDROID_SDK}/tools/android.bat create project --path ${CMAKE_CURRENT_BINARY_DIR}/android --target android-19 --name PemApp --package com.pem.PemApp --activity PemActivity) include_directories(${ANDROID_NDK}/sources/android/native_app_glue) set(SRC_LIST "${SRC_LIST}" "${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c") set(SRC_LIST "${SRC_LIST}" "${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.h") set(SRC_LIST "${SRC_LIST}" "${CMAKE_CURRENT_BINARY_DIR}/android/AndroidManifest.xml") LINK_LIBRARIES(android) # ??? https://stackoverflow.com/questions/19207721/build-android-ndk-project-with-cmake set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -ffor-scope -fno-rtti -fno-exceptions -pipe -ffunction-sections -fdata-sections -ffast-math -Wnon-virtual-dtor -Wreorder -Wsign-promo -fvisibility=hidden -fvisibility-inlines-hidden -Wstrict-null-sentinel -Os -funroll-all-loops -fpeel-loops -ftree-vectorize") set(LINKER_FLAGS "${LINKER_FLAGS} -Wl,--as-needed -Wl,--gc-sections -Wl,--no-undefined -Wl,--strip-all -Wl,-rpath-link=${ANDROID_NDK_SYSROOT}/usr/lib/ -L${ANDROID_NDK_SYSROOT}/usr/lib/") LINK_DIRECTORIES(${dirSDLmain}) LINK_DIRECTORIES(${dirSDL}) LINK_LIBRARIES(SDL2) add_library(${PROJECT_NAME} SHARED ${SRC_LIST}) [END CMakeLists.txt] My cmake command is: cd build-android cmake -G"Visual Studio 10 2010" -DCMAKE_SYSTEM_NAME="Android" ..\pemDemos This generates a visual studio solution that is similar to the "Android Native Application". I am able to build for target (Debug, Tegra-Android) in Visual Studio, and it builds two .so files (libpemDemos.so, stripped_libpemDemos.so) (aside I'm not sure what the stripped_* file is for). However, when I attempt to run it from Visual Studio with Ctrl+F5, it gives the error - Cannot find the package to deploy. Make sure it has been built. [path]\build-Android\Debug\pemDemos.apk. Upon closer inspection, I notice that my working Android Native Application vcxproj > properties has a section for Ant Build. But my pemDemos.vcxproj does not. So how do I tell cmake to include this "Ant Build" portion in my vcxproj? At this point I could probably go off and try to figure out how to package this .so in my APK such that it will call my main(), SDL_main(), or android_main(). I made some progress in packaging an APK with these commands: cd [path]\build-android\android\ mkdir libs\armeabi-v7a cp ..\Debug\*.so libs\armeabi-v7a cp ..\..\..\SDL2-2.0.3\libs\armeabi\*.so libs\armeabi-v7a ant debug cd [path]\build-android\android\bin adb devices adb start-server adb -s [device ID] install PemApp-
[cmake-developers] FindZLIB module should find debug and, release variants
I don't think so. The debug suffix is a Windows-ism which you don't see on UNIX. Okay great, I thought this was the case. One criticism of the patch: It's not using SelectLibraryConfigurations to choose between the release and debug variants. Could it be updated to do that for consistency? See FindPNG.cmake as an example. This should make the patch quite a bit simpler. Okay no problem, I've changed the patch to use SelectLibraryConfigurations instead. I've also changed the last bit of the patch, to set the "IMPORTED_CONFIGURATIONS" target property as well when there's debug and release variants, to be consistent with other Find modules. Let me know if this shouldn't be done in this situation. Cheers, Michael From 92e2d4933d57305fb1b9343c16b68d36c1a29c09 Mon Sep 17 00:00:00 2001 From: Michael Scott Date: Sun, 23 Aug 2015 10:45:27 +0100 Subject: [PATCH] Find the debug and release variants as separate libraries, providing both in ZLIB_LIBRARIES and ZLIB::ZLIB's imported location properties, when both are found. --- Modules/FindZLIB.cmake | 24 +++- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake index d4a27d5..5de9acc 100644 --- a/Modules/FindZLIB.cmake +++ b/Modules/FindZLIB.cmake @@ -74,15 +74,20 @@ set(_ZLIB_SEARCH_NORMAL ) list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL) -set(ZLIB_NAMES z zlib zdll zlib1 zlibd zlibd1) +set(ZLIB_NAMES z zlib zdll zlib1) +set(ZLIB_NAMES_DEBUG zlibd zlibd1) # Try each search configuration. foreach(search ${_ZLIB_SEARCHES}) find_path(ZLIB_INCLUDE_DIR NAMES zlib.h${${search}} PATH_SUFFIXES include) - find_library(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib) + find_library(ZLIB_LIBRARY_RELEASE NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib) + find_library(ZLIB_LIBRARY_DEBUG NAMES ${ZLIB_NAMES_DEBUG} ${${search}} PATH_SUFFIXES lib) endforeach() -mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR) +include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) +select_library_configurations(ZLIB) + +mark_as_advanced(ZLIB_LIBRARY_RELEASE ZLIB_LIBRARY_DEBUG ZLIB_INCLUDE_DIR) if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h") file(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$") @@ -112,12 +117,21 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_D if(ZLIB_FOUND) set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) -set(ZLIB_LIBRARIES ${ZLIB_LIBRARY}) if(NOT TARGET ZLIB::ZLIB) add_library(ZLIB::ZLIB UNKNOWN IMPORTED) set_target_properties(ZLIB::ZLIB PROPERTIES -IMPORTED_LOCATION "${ZLIB_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}") + + if(ZLIB_LIBRARY_DEBUG) +set_property(TARGET ZLIB::ZLIB APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE DEBUG) +set_target_properties(ZLIB::ZLIB PROPERTIES + IMPORTED_LOCATION_RELEASE "${ZLIB_LIBRARY_RELEASE}" + IMPORTED_LOCATION_DEBUG "${ZLIB_LIBRARY_DEBUG}") + else() +set_target_properties(ZLIB::ZLIB PROPERTIES + IMPORTED_LOCATION "${ZLIB_LIBRARY_RELEASE}") + endif() endif() endif() -- 2.1.4 -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers
[cmake-developers] FindBZip2.cmake
Brad, you introduced in 7c912af2 that this module not only looks into the Windows registry, but also added PATH_SUFFIXES include and lib for find_* calls. Am I gettings something wrong? Wouldn't CMake automatically append those to all paths given? Another thing which I found is that there seems to be an obscure problem in FindBZip2.cmake to not find the library on Windows if the path contains backslashes. Yes, really. Just compare the cmake part of these 2 links (no idea how long they will present, as they are CI logs): https://ci.appveyor.com/project/Mapbox/libosmium/build/1.0.228/job/my1segqcq89k28en https://ci.appveyor.com/project/Mapbox/libosmium/build/1.0.227/job/rnu1e71degn7snwm I have no clue what happens there, why it happens only for that module, and why noone noticed that before. I do not have access to a Windows system where I can test easily, but maybe you can have a look (or find someone to)? I thought that it may be "\b", because that would be unique to that module in that build configuration, but if I pass the CMAKE_PREFIX_PATH with forward slash at that point it still fails, while all other modules work. Everyone else interested may of course have a look, too. Greetings, Eike signature.asc Description: This is a digitally signed message part. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers
[cmake-developers] I fear $ is not really useful...
Yes, sadly. I have this code: if (NOT CMAKE_VERSION VERSION_LESS 3.1) set_property(TARGET osmium_convert PROPERTY CXX_STANDARD 11) target_compile_definitions(osmium_convert PRIVATE $<$:BOOST_RESULT_OF_USE_DECLTYPE>) endif() So, in theory, this will set the definition if the compiler supports decltype, and just don't set it if not. And it works fine for g++. The problem is when it comes to MSVC: There is no MSVC version that supports this feature properly, so there is no variable for this compiler defined. Or just think of $FooBarC++, where noone cared to report the supported features. No variable either. For these compilers the above expression fails, because this is no recorded feature of the compiler. I would have expected it to just not set the definition, but not error out. So for now my code is: if (NOT CMAKE_VERSION VERSION_LESS 3.1 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") ... Greetings, Eike signature.asc Description: This is a digitally signed message part. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers
Re: [cmake-developers] FindZLIB module should find debug and release variants
On 23/08/2015 10:07, Michael Scott wrote: Carrying on in the list of open issues to look at for contributing to CMake, I've had a look at issue "15280 - FindZLIB module should find debug and release variants". I've made some changes to the FindZLIB module which should make it so that debug and release variants are found as separate libraries, if they're both found then they're provided in ZLIB_LIBRARIES and ZLIB::ZLIB's imported location properties. Attached is the patch for FindZLIB.cmake. With this, I noticed that the Windows DLL's use different file names for the release and debug variants, but I couldn't tell if this is true on UNIX, it didn't seem to be the case. As the change to FinZLIB is based on the two variants having different names, I'm not sure these changes will have any effect on UNIX, is this expected or am I missing something/going about it the wrong way? I don't think so. The debug suffix is a Windows-ism which you don't see on UNIX. One criticism of the patch: It's not using SelectLibraryConfigurations to choose between the release and debug variants. Could it be updated to do that for consistency? See FindPNG.cmake as an example. This should make the patch quite a bit simpler. Regards, Roger -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers
Re: [cmake-developers] FindZLIB module should find debug and release variants
Michael Scott wrote: > Hi, > > Carrying on in the list of open issues to look at for contributing to > CMake, I've had a look at issue "15280 - FindZLIB module should find > debug and release variants". I've made some changes to the FindZLIB > module which should make it so that debug and release variants are found > as separate libraries, if they're both found then they're provided in > ZLIB_LIBRARIES and ZLIB::ZLIB's imported location properties. Attached > is the patch for FindZLIB.cmake. > > With this, I noticed that the Windows DLL's use different file names for > the release and debug variants, but I couldn't tell if this is true on > UNIX, it didn't seem to be the case. As the change to FinZLIB is based > on the two variants having different names, I'm not sure these changes > will have any effect on UNIX, is this expected or am I missing > something/going about it the wrong way? On Unix systems those variants usually do not exists, as there are no different standard libraries (and therefore e.g. allocators) used for release and debug mode. You should use SelectLibraryConfigurations.cmake instead of building the list of libraries yourself. Look at FindPNG.cmake, which uses it. I wonder if we should add a function or macro to SLC which does the target fiddling which is done at the bottom of the patch. Eike -- signature.asc Description: This is a digitally signed message part. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers
[cmake-developers] FindZLIB module should find debug and release variants
Hi, Carrying on in the list of open issues to look at for contributing to CMake, I've had a look at issue "15280 - FindZLIB module should find debug and release variants". I've made some changes to the FindZLIB module which should make it so that debug and release variants are found as separate libraries, if they're both found then they're provided in ZLIB_LIBRARIES and ZLIB::ZLIB's imported location properties. Attached is the patch for FindZLIB.cmake. With this, I noticed that the Windows DLL's use different file names for the release and debug variants, but I couldn't tell if this is true on UNIX, it didn't seem to be the case. As the change to FinZLIB is based on the two variants having different names, I'm not sure these changes will have any effect on UNIX, is this expected or am I missing something/going about it the wrong way? Cheers, Michael From 9d1aa288cc68008797cbf67d0fe86a8713b4ad29 Mon Sep 17 00:00:00 2001 From: Michael Scott Date: Sun, 23 Aug 2015 10:45:27 +0100 Subject: [PATCH] Find the debug and release variants as separate libraries, providing both in ZLIB_LIBRARIES and ZLIB::ZLIB's imported location properties, when both are found. --- Modules/FindZLIB.cmake | 23 +++ 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake index d4a27d5..b572b09 100644 --- a/Modules/FindZLIB.cmake +++ b/Modules/FindZLIB.cmake @@ -74,15 +74,17 @@ set(_ZLIB_SEARCH_NORMAL ) list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL) -set(ZLIB_NAMES z zlib zdll zlib1 zlibd zlibd1) +set(ZLIB_NAMES z zlib zdll zlib1) +set(ZLIB_NAMES_DEBUG zlibd zlibd1) # Try each search configuration. foreach(search ${_ZLIB_SEARCHES}) find_path(ZLIB_INCLUDE_DIR NAMES zlib.h${${search}} PATH_SUFFIXES include) find_library(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib) + find_library(ZLIB_LIBRARY_DEBUG NAMES ${ZLIB_NAMES_DEBUG} ${${search}} PATH_SUFFIXES lib) endforeach() -mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR) +mark_as_advanced(ZLIB_LIBRARY ZLIB_LIBRARY_DEBUG ZLIB_INCLUDE_DIR) if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h") file(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$") @@ -112,12 +114,25 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_D if(ZLIB_FOUND) set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) -set(ZLIB_LIBRARIES ${ZLIB_LIBRARY}) + +if(ZLIB_LIBRARY_DEBUG) +set(ZLIB_LIBRARIES optimized ${ZLIB_LIBRARY} debug ${ZLIB_LIBRARY_DEBUG}) +else() +set(ZLIB_LIBRARIES ${ZLIB_LIBRARY}) +endif() if(NOT TARGET ZLIB::ZLIB) add_library(ZLIB::ZLIB UNKNOWN IMPORTED) set_target_properties(ZLIB::ZLIB PROPERTIES -IMPORTED_LOCATION "${ZLIB_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}") + + if(ZLIB_LIBRARY_DEBUG) +set_target_properties(ZLIB::ZLIB PROPERTIES + IMPORTED_LOCATION_RELEASE "${ZLIB_LIBRARY}" + IMPORTED_LOCATION_DEBUG "${ZLIB_LIBRARY_DEBUG}") + else() +set_target_properties(ZLIB::ZLIB PROPERTIES + IMPORTED_LOCATION "${ZLIB_LIBRARY}") + endif() endif() endif() -- 2.1.4 -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers