diff --git a/CMakeLists.txt b/CMakeLists.txt
index 015d24df801fc653c5c0313dd7059e2b95eef980..fd227252396260ecf12e94acf9317e303156bf37 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,8 +1,12 @@
 cmake_minimum_required( VERSION 3.27 FATAL_ERROR )
 
-message(VERBOSE "Entering libcdi")
+message(VERBOSE "Entering cdilib")
 project(cdilib VERSION 2.5.1 LANGUAGES C )
 set(CMAKE_C_STANDARD 11)
+set(CMAKE_EXPORT_COMPILE_COMMANDS YES)
+
+add_library(cdilib)
+add_library(cdilib::cdilib ALIAS cdilib)
 
 include(CTest)
 include(CheckIncludeFile)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 26ea963f1b0e27f9204c6cf8a2473d665a556bda..250f7a92893c2e9f4e94068e75eaa6908d0824f7 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -199,16 +199,12 @@ endif ()
 # Support exporting all symbolds on Windows
 set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
 
-add_library(cdilib
-  ${cdi_src_files}
-#  INSTALL_HEADERS_LIST  cdi.h
 )
 
 target_include_directories(cdilib PRIVATE "${PROJECT_BINARY_DIR}/src/config.h")
 target_link_libraries(cdilib ${cdi_linked_libs})
 target_compile_definitions(cdilib PRIVATE PACKAGE_NAME="${PROJECT_NAME}" VERSION="${CMAKE_PROJECT_VERSION}" ${cdi_compile_defs})
 
-add_library(cdilib::cdilib ALIAS cdilib)
 
 include(GNUInstallDirs)
 install(FILES cdi.h calendar.h cdi_datetime.h julian_date.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")