sa-mustafa opened a new issue #17943: CMake build misses some parameters URL: https://github.com/apache/incubator-mxnet/issues/17943 ## Description When CMake is used to build the MXNet 1.6.0 on Windows, some errors are generated pertaining to missing options. ### Error Message CMake Error at {build_path}/cmake-3.15/Modules/FindGTest.cmake:209 (add_library): ``` CMake Error at D:/Build/cmake-3.15.0/share/cmake-3.15/Modules/FindGTest.cmake:209 (add_library): add_library called with IMPORTED argument but no library type. Call Stack (most recent call first): CMakeLists.txt:477 (find_package) CMake Error at D:/Build/cmake-3.15.0/share/cmake-3.15/Modules/FindGTest.cmake:211 (set_target_properties): set_target_properties Can not find target to add properties to: GTest::GTest Call Stack (most recent call first): CMakeLists.txt:477 (find_package) CMake Error at D:/Build/cmake-3.15.0/share/cmake-3.15/Modules/FindGTest.cmake:219 (set_target_properties): set_target_properties Can not find target to add properties to: GTest::GTest Call Stack (most recent call first): CMakeLists.txt:477 (find_package) CMake Error at D:/Build/cmake-3.15.0/share/cmake-3.15/Modules/FindGTest.cmake:134 (set_property): set_property could not find TARGET GTest::GTest. Perhaps it has not yet been created. Call Stack (most recent call first): D:/Build/cmake-3.15.0/share/cmake-3.15/Modules/FindGTest.cmake:224 (__gtest_import_library) CMakeLists.txt:477 (find_package) CMake Error at D:/Build/cmake-3.15.0/share/cmake-3.15/Modules/FindGTest.cmake:137 (set_target_properties): set_target_properties Can not find target to add properties to: GTest::GTest Call Stack (most recent call first): D:/Build/cmake-3.15.0/share/cmake-3.15/Modules/FindGTest.cmake:224 (__gtest_import_library) CMakeLists.txt:477 (find_package) CMake Error at D:/Build/cmake-3.15.0/share/cmake-3.15/Modules/FindGTest.cmake:143 (set_target_properties): set_target_properties Can not find target to add properties to: GTest::GTest Call Stack (most recent call first): D:/Build/cmake-3.15.0/share/cmake-3.15/Modules/FindGTest.cmake:224 (__gtest_import_library) CMakeLists.txt:477 (find_package) CMake Error at D:/Build/cmake-3.15.0/share/cmake-3.15/Modules/FindGTest.cmake:228 (add_library): add_library called with IMPORTED argument but no library type. Call Stack (most recent call first): CMakeLists.txt:477 (find_package) ``` ## To Reproduce Just build the MXNet v1.6.0 project on Windows 8.1 (version is irrelevant). The CMake generates errors related to GTest options. ## What have you tried to solve it? Reading the CMake scripts helped find the cause. Two options are missing from the main CMakeList.txt file of the project. The CMake script needs to specify how to link with GTest library as shared/static/object or whatever. Just add the following two lines to CMakeList.txt @ line 472: ```cmake set(GTEST_LIBRARY_TYPE SHARED) set(GTEST_MAIN_LIBRARY_TYPE SHARED) ```
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services