I'm starting a new C++ project and thought it would be a good time to try and learn CMake in the process. So I tried to set up everything so that my JobScheduler project would be a library that I would use in the test run. You can see below my different CMakeLists:
Top level folder CMakeLists
cmake_minimum_required(VERSION 3.2)
project(JobScheduler
VERSION 1.0
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
add_subdirectory(Tests)
add_subdirectory(JobScheduler)
"Tests" folder CMakeLists
cmake_minimum_required(VERSION 3.2)
add_executable (JobSchedulerDemo main.cpp)
target_link_libraries (JobSchedulerDemo LINK_PUBLIC JobSchedulerLib)
"JobScheduler" folder CMakeLists
cmake_minimum_required(VERSION 3.2)
add_library(JobSchedulerLib test.h)
set_target_properties(JobSchedulerLib PROPERTIES LINKER_LANGUAGE C++)
target_include_directories (JobSchedulerLib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
But when I try to generate I have these 2 errors:
1> [CMake] CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
1> [CMake] Missing variable is:
1> [CMake] CMAKE_C++_ARCHIVE_CREATE
1> [CMake] CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
1> [CMake] Missing variable is:
1> [CMake] CMAKE_C++_ARCHIVE_FINISH
I tried to google it without success. Can anyone helps?