Setting CMAKE_EXECUTABLE_SUFFIX and TARGET_SUPPORTS_SHARED_LIBS from toolchain file is not possible
Hi,
i am writing a toolchainfile for an embedded operating system. This OS has file extensions for its executables and does not support shared libraries. As i see this, this is something that should be noted in the toolchain file.
Its not possible.
I have to apply these settings after the project() call, which is inside the top level CMakeLists.txt. Since this project is also compiled for Linux, we have to do some nasty workaround in the projects CMakeLists.txt to fix this.
You can reproduce this issue without a toolchain file:
SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS "TRUE") GET_PROPERTY(test GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS) set(CMAKE_EXECUTABLE_SUFFIX .ext) MESSAGE("TOPDIR1: -" ${test} "- -" ${CMAKE_EXECUTABLE_SUFFIX} "-") project(mytestproject) GET_PROPERTY(test GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)