In more simple case: print_properties TARGET:

 ---

(20200926: )
$ cd build
$ cmake ..
CMake Error: The current CMakeCache.txt directory / .../src/20200926/build/CMakeCache.txt is different than the directory /home/ .../src/20200924/build where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt
CMake Error: The source "/ .../src/20200926/CMakeLists.txt" does not match the source "/ .../src/20200924/CMakeLists.txt" used to generate cache.  Re-run cmake with a different source directory.
$

--- CMakeLists.txt ---
cmake_minimum_required(VERSION 2.8.12.2)

project(lib_a)

#add_executable(Tutorial main.c)
#configure_file(TutorialConfig.h.in TutorialConfig.h)
#configure_file(array_counter.h.in array_counter.h)

set(wxSOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(wxBINARY_DIR ${CMAKE_BINARY_DIR})
set(wxOUTPUT_DIR ${wxBINARY_DIR}/lib)

print_properties ( TARGET, "../20200924" )
--- CMakeLists.txt ---

 

(20200927: )
Add includion of cmake_properties:
I could include but see error:


CMake Error at CMakeLists.txt:19 (print_properties):
  Unknown CMake command "print_properties".


-- Configuring incomplete, errors occurred!


ADD: include:

   get_cmake_property( _variableNames VARIABLES )
   foreach( _variableName ${_variableNames} )
      message( STATUS "${_variableName}=${${_variableName}}" )
   endforeach()

   include( PrintProperties )
   print_properties( TARGET "." )

---

(20200927: )
I check the specification: written as "cmake_print_properties".

https://cmake.org/cmake/help/v2.8.12/cmake.html#command:get_cmake_property
CMAKE_PRINT_PROPERTIES([TARGETS target1 .. targetN]

                        [SOURCES source1 .. sourceN]
                        [DIRECTORIES dir1 .. dirN]
                        [TESTS test1 .. testN]
                        [CACHE_ENTRIES entry1 .. entryN]
                        PROPERTIES prop1 .. propN )
This macro prints the values of the properties of the given targets, source files, directories, tests or cache entries. Exactly one of the scope keywords must be used. Example:

   cmake_print_properties(TARGETS foo bar PROPERTIES LOCATION INTERFACE_INCLUDE_DIRS)

This will print the LOCATION and INTERFACE_INCLUDE_DIRS properties for both targets foo and bar.  

---

(20200927: )
we don't know the reason the below, we can not find command.

CMake Error at CMakeLists.txt:13 (cmake_print_properties):
  Unknown CMake command "cmake_print_properties".


-- Configuring incomplete, errors occurred!
See also "/home/nakagawa/src/20200927/build/CMakeFiles/CMakeOutput.log".

---


(20200927: )
Anyway , we ignore "print_properties".
$ cmake ..
-- The C compiler identification is GNU 4.4.7
-- The CXX compiler identification is GNU 4.4.7
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/.../src/20200927/lib/build

---




コメント